docker image tag

docker image tag

Description

Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE

Usage

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

Parent command

Command Description
docker image Manage images

Examples

Tagging an image referenced by ID

To tag a local image with ID “0e5574283393” into the “fedora” repository with “version1.0”:

docker image tag 0e5574283393 fedora/httpd:version1.0

Tagging an image referenced by Name

To tag a local image with name “httpd” into the “fedora” repository with “version1.0”:

docker image tag httpd fedora/httpd:version1.0

Note that since the tag name is not specified, the alias is created for an existing local version httpd:latest.

Tagging an image referenced by Name and Tag

To tag a local image with name “httpd” and tag “test” into the “fedora” repository with “version1.0.test”:

docker image tag httpd:test fedora/httpd:version1.0.test

Tagging an image for a private repository

To push an image to a private registry and not the central Docker registry you must tag it with the registry hostname and port (if needed).

docker image tag 0e5574283393 myregistryhost:5000/fedora/httpd:version1.0

© 2013–2016 Docker, Inc.
Licensed under the Apache License, Version 2.0.
Docker and the Docker logo are trademarks or registered trademarks of Docker, Inc. in the United States and/or other countries.
Docker, Inc. and other parties may also have trademark rights in other terms used herein.
https://docs.docker.com/engine/reference/commandline/image_tag/

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部