Open3

Docker Tagging: Best practices for tagging and versioning docker images

輝

Details

Stable tags

Recommendation: Use stable tags to maintain base images for your container builds. Avoid deployments with stable tags, because those tags continue to receive updates and can introduce inconsistencies in production environments.

Unique tags

Recommendation: Use unique tags for deployments, especially in an environment that could scale on multiple nodes. You likely want deliberate deployments of a consistent version of components. If your container restarts or an orchestrator scales out more instances, your hosts won’t accidentally pull a newer version, inconsistent with the other nodes.

  • Git commit の場合
    • 指摘されたことは特に問題なさそう:base image のアップデートがある場合は、dockerfile の更新が必要になるため新しい git commit が発生するはず。この場合は違う git commit をベースにして新しいタグが生成されるはず。
    • Git commit – This approach works until you start supporting base image updates. If a base image update happens, your build system kicks off with the same Git commit as the previous build. However, the base image has new content. In general, a Git commit provides a semi-stable tag.

輝

感想

  • Stable tags は現状社内ではまだ使う必要がない。なぜなら base image は自分で作成しないため
  • Unique tags はデプロイの時に使っている。Git commit を使って問題なさそう