✦ For everyone, free.

Practical knowledge for real and everyday life

Home

14.1.1.4 Production Version Tag

A focused guide to Production Version Tag, connecting core concepts with practical Docker and container operations.

Production version tag ensures a production deployment always references a specific, precise, immutable image version — never a floating tag like latest — providing the clear traceability and predictable behavior that production environments specifically require.

Why latest Is Particularly Unsuitable for Production

The latest tag, by convention rather than any technical guarantee, typically points to whatever was most recently pushed — using it in production means a routine redeploy could silently pull an entirely different, unintended version.

services:
  app:
    image: registry.example.com/myapp:latest
services:
  app:
    image: registry.example.com/myapp:v1.4.2

The second, precisely versioned reference guarantees exactly which version is deployed, while the first carries no such guarantee at all.

Why Precise Versioning Enables Reliable Traceability

A specific version tag (or even better, a content digest) allows immediately and unambiguously identifying exactly what's running in production at any given time.

docker inspect myapp --format '{{.Config.Image}}'
registry.example.com/myapp:v1.4.2

This clear, unambiguous identification is essential for debugging an issue or coordinating a rollback.

Establishing a Consistent Versioning Scheme

Adopting a clear, consistent versioning convention (semantic versioning, or commit-SHA-based versioning) provides a predictable, well-understood structure for these production tags.

docker tag myapp:abc123 myapp:v1.4.2
docker push myapp:v1.4.2
Enforcing This Practice Through Deployment Tooling

Deployment scripts or pipeline configuration can explicitly reject an attempt to deploy using latest or an otherwise ambiguous tag.

if [[ "$IMAGE_TAG" == "latest" ]]; then echo "Refusing to deploy 'latest' to production" && exit 1; fi
Why Production Version Tag Matters

Always deploying production using a specific, immutable version reference — never a floating tag — is foundational to maintaining the traceability, predictability, and reliable rollback capability a production environment genuinely requires.