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
docker images
Lists images stored in the local image store with their repository, tag, ID, and size. Alias for docker image ls.
docker push
Uploads a local image or repository to a container registry. The image must be tagged with the registry hostname and repository path before pushing.
docker pull
Downloads an image or repository from a registry into the local image store. Defaults to Docker Hub and the latest tag when unspecified.
docker build
Builds an image from a Dockerfile and a build context. In Docker 23+ this invokes BuildKit by default and supports multi-platform, secrets, and cache mounts.
docker rmi
Removes one or more images from the local image store. Alias for docker image rm.
← All Docker commands · Docker vs Kubernetes · Docker vs VMs