Build tags your registry will accept
The Docker Tag Generator produces image tag strings that follow Docker’s tag grammar and common CI conventions. Pick a style — semantic version, short git hash, the two combined, or a timestamp — add an optional environment suffix, and get tags you can drop straight into a docker build -t command or a pipeline script.
How it works
Docker restricts a tag to letters, digits, underscores, periods and hyphens, with a 128-character limit and no leading period or hyphen. The generator builds each tag from those characters only. A semver core is MAJOR.MINOR.PATCH; a git-style identifier is a seven-character lowercase hex string mimicking an abbreviated commit SHA; a timestamp is a sortable YYYYMMDD-HHMM stamp.
The combined version-sha style joins a release with its source commit (for example 1.4.0-a1b2c3d) so the tag is both readable and immutable. An optional environment suffix such as -staging records the build target. Because mutable tags like latest defeat reproducible deploys, the tool deliberately produces immutable, content-anchored tags instead.
Tips and example
- For release builds use the
versionorversion-shastyle:2.0.1or2.0.1-9f3c0de. - For per-commit CI builds use the
git-shastyle so each push gets a unique, immutable tag. - For nightly builds use the
timestampstyle:20260606-0300. - Keep tags lowercase by convention even though uppercase is technically allowed — many tools and humans expect it.
- All hashes and stamps are synthetic; never treat a generated tag as a real build artifact.