Version tag

2 snippets across 2 stacks — Docker, Git

Also written as version tags

DKDocker

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.

GitGit

Create an Annotated Tag

Git · Tags
syntax
git tag -a <name> -m "message" [commit]
example
git tag -a v2.0.0 -m "Major release: new payment system"
git tag -a v1.5.0 -m "Performance improvements" a1b2c3d

Note Annotated tags store the tagger's name, email, date, and a message. They're full Git objects. Use these for releases so you have a record of who tagged and why.