Linux command
docker-image-tag 命令
文件
复制后可按需替换文件名、目录或参数。
常用示例
Tag a local image with a name and version
docker image tag [source_image]:[tag] [target_image]:[version]
Tag an image for a private registry
docker image tag [image]:[tag] [registry.example.com:5000/image]:[tag]
Tag an image by its ID
docker image tag [image_id] [repository]:[tag]
Create a latest tag from a versioned image
docker image tag [image]:[version] [image]:latest
说明
docker image tag creates a tag that refers to an existing image. Tags are aliases for image IDs and are used to version images and push them to registries. Multiple tags can point to the same image, allowing different versioning schemes or registry locations without duplicating the image data. A tag name must be valid ASCII and may contain lowercase and uppercase letters, digits, underscores, periods, and hyphens. It may not start with a period or hyphen and is limited to 128 characters. If no tag is specified, latest is used by default for both the source and target.
FAQ
What is the docker-image-tag command used for?
docker image tag creates a tag that refers to an existing image. Tags are aliases for image IDs and are used to version images and push them to registries. Multiple tags can point to the same image, allowing different versioning schemes or registry locations without duplicating the image data. A tag name must be valid ASCII and may contain lowercase and uppercase letters, digits, underscores, periods, and hyphens. It may not start with a period or hyphen and is limited to 128 characters. If no tag is specified, latest is used by default for both the source and target.
How do I run a basic docker-image-tag example?
Run `docker image tag [source_image]:[tag] [target_image]:[version]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
Where can I find more docker-image-tag examples?
This page includes 4 examples for docker-image-tag, plus related commands for nearby Linux tasks.