---
title: "Docker Best Practices: Using Tags and Labels to Manage Docker Image Sprawl"
description: "Docker's `latest` tag does not mean the newest version: it is simply applied to the most recent build or push made without an explicit tag, and mutable tags like `v1.0.0` can be silently overwritten or mis-applied."
url: "https://swe.quest/articles/docker-best-practices-using-tags-and-labels-to-manage-docker-image-sprawl-d8a774fa8d22d181"
canonical: "https://www.docker.com/blog/docker-best-practices-using-tags-and-labels-to-manage-docker-image-sprawl/"
source: "Docker"
published: "2024-10-01"
difficulty: "medium"
kind: "How-to"
reading_minutes: 6
tags: ["containers","deployment"]
---

# Docker Best Practices: Using Tags and Labels to Manage Docker Image Sprawl

A post on [Docker](https://swe.quest/sources/docker.md), published 2024-10-01, 6 min read, How-to. Original: [https://www.docker.com/blog/docker-best-practices-using-tags-and-labels-to-manage-docker-image-sprawl/](https://www.docker.com/blog/docker-best-practices-using-tags-and-labels-to-manage-docker-image-sprawl/)

## Summary

Docker's \`latest\` tag does not mean the newest version: it is simply applied to the most recent build or push made without an explicit tag, and mutable tags like \`v1.0.0\` can be silently overwritten or mis-applied. A worked example shows \`latest\` pointing to 1.0.0 after 1.0.1 ships, and a \`1.0.1\` tag actually running 1.0.2 code. The recommended fix is embedding version metadata with the \`LABEL\` instruction, which can be checked via \`docker inspect\` without running the container. It also suggests using the OCI \`org.opencontainers.image.\*\` label set and namespaced custom labels for team-specific metadata.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Containers](https://swe.quest/tags/containers.md) (Infrastructure)
- [Deployment](https://swe.quest/tags/deployment.md) (Reliability & operations)

## Prerequisites

- Dockerfile basics
- container registries

## Keywords

Docker, OCI image labels, docker inspect, Dockerfile LABEL

## Related posts

- [Trivy supply chain compromise: What Docker Hub users should know](https://swe.quest/articles/trivy-supply-chain-compromise-what-docker-hub-users-should-know-765818eeb0f714d2.md): Docker · 2026-03-23 · Medium · 5 min read · Supply chain security, Containers, Incidents & postmortems, CI/CD
  Attackers used stolen Aqua Security publishing credentials to push infostealer-laden aquasec/trivy images (0.69.4, 0.69.5, 0.69.6 and latest) to Docker Hub between March 19 and March 23, 2026.
- [Making the Most of Your Docker Hardened Images Enterprise Trial – Part 3](https://swe.quest/articles/making-the-most-of-your-docker-hardened-images-enterprise-trial-part-3-074fb74ac78adf47.md): Docker · 2026-01-25 · Medium · 8 min read · Containers, Supply chain security, Security
  Docker Hardened Images (DHI) ship without package managers, shells or utilities, so adding agents, CA certificates or libraries needs one of two patterns.
- [Introducing Docker Build Checks: Optimize Dockerfiles with Best Practices](https://swe.quest/articles/introducing-docker-build-checks-optimize-dockerfiles-with-best-practices-2400d0a2e13e5604.md): Docker · 2024-07-29 · Medium · 6 min read · Containers, Static analysis, CI/CD, Developer tools
  Docker Desktop 4.33 adds Build checks, which evaluate Dockerfiles against codified best-practice rules during \`docker build\` and report warnings.
- [Hardened Images Are Free. Now What?](https://swe.quest/articles/hardened-images-are-free-now-what-129617cf36f8913b.md): Docker · 2026-02-10 · Medium · 6 min read · Supply chain security, Containers, Security
  Docker Hardened Images (DHI), now free across 1,000+ images, establish a security "waterline": Docker owns vulnerability remediation for the base layers it hardens, while teams own application code and dependencies above it.
- [Securing the Docker MCP Catalog: Commit Pinning, Agentic Auditing, and Publisher Trust Levels](https://swe.quest/articles/securing-the-docker-mcp-catalog-commit-pinning-agentic-auditing-and-publisher-91efbeaa90e18d9c.md): Docker · 2025-12-03 · Medium · 8 min read · Supply chain security, AI agents, Sandboxing & isolation, Containers, CI/CD
  Docker's MCP Registry now pins every Docker-built MCP server to a specific Git commit, enforced in CI and propagated to the org.opencontainers.image.revision label, so builds are deterministic and verifiable with docker inspect or cosign.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
