PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, September 28, 2022

[FIXED] What is the best Docker tagging strategy?

 September 28, 2022     continuous-deployment, continuous-integration, docker, jenkins     No comments   

Issue

It is certain, that "latest" tag is not enough (i.e. if you want to rollback/debug).

What is the best docker tagging practice? Is it better to tag it with build number or commit number? Or some other option?


Solution

We don't use tagging for development environment, because we have pretty nice test coverage, but I suggest, you can easily tag container with your CI tool build number (Teamcity, Jenkins), something like

docker build -t {yourserviceName}:{JENKINS BUILD NUMBER}

However, production deployments - is a little bit different story. We use two tags for that - previous and latest

1.Build production container on teh build server

2.Push it to shared repo

3.Pull to production server.

The latest tag is always contained at shared repository. Before step 3, just re-tag existing running container to previous.

What's the benefit?

If you have your latest container with critical failure, you just rollback to previous one. It's extremely rare case, when you have to do a rapid rollback, let's say, 4 deployments back, so no need to maintain versions there



Answered By - Andrew
Answer Checked By - Gilberto Lyons (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing