images

docker tag

Creates a new tag (alias) that refers to an existing image. Tagging is required before pushing to a registry whose hostname is not Docker Hub.

docker tag SOURCE_IMAGE[:TAG] TARGET_IMAGE[:TAG]

Examples

docker tag myapp:latest myuser/myapp:1.0

Retag for Docker Hub push

docker tag myapp:1.0 ghcr.io/org/myapp:1.0

Tag for GitHub Container Registry

docker tag abc123def456 myapp:hotfix

Tag directly from an image ID

docker tag myapp:1.0 registry.internal:5000/myapp:1.0

Tag for a private registry with custom port

Gotcha

docker tag takes no flags — it's purely positional: `docker tag SOURCE_IMAGE[:TAG] TARGET_IMAGE[:TAG]`. Tagging does not push; you still need `docker push` afterwards.

Related commands

← All Docker commands · Docker vs Kubernetes · Docker vs VMs