Tag image

2 snippets in Docker

Also written as image tags

DKDocker

Tag an Image

DK · Images
syntax
docker tag <source_image>[:<tag>] <target_image>[:<tag>]
example
docker tag myapp:1.0 registry.example.com/myapp:1.0
docker tag myapp:1.0 myapp:latest

Note Tagging does not duplicate image layers — it just creates a new reference pointing to the same image ID. You can have many tags for one image.

Tag Naming Conventions

DK · Registry & Distribution
syntax
<image>:<version>
<image>:<version>-<variant>
example
myapp:2.1.0
myapp:2.1.0-alpine
myapp:2.1
myapp:latest
myapp:main-abc1234

Note Common patterns: semver (2.1.0), major.minor (2.1), variant suffix (-alpine, -slim), git-based (main-abc1234, sha-abc1234). Never rely on :latest in production — it is a mutable tag and gives you no way to reproduce a specific build.