We do not use tagging for the development environment, because we have pretty good coverage for testing, but I suggest that you can easily mark the container with your CI tool assembly number (Teamcity, Jenkins), something like
docker build -t {yourserviceName}: {JENKINS BUILD NUMBER}
However, the deployment of production is a slightly different story. For this we use two tags: previous and last
1.Build build container on build server
2.Push it for a common repo
3. Go to the production server.
The last tag is always contained in a common repository. Before step 3, simply repeat the tag of the existing current container previous .
What is the use?
If you have your last container with a critical failure, you simply roll back to the previous one . This is an extremely rare case when you need to perform a quick rollback, say, 4 deployments, so there is no need to maintain versions there
source share