我正在尝试更改图像的存储库名称:
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
server latest d583c3ac45fd 26 minutes ago 685.5 MB
因此,我想将名称服务器更改为类似myname/server的名称:
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
myname/server latest d583c3ac45fd 26 minutes ago 685.5 MB
我该怎么做?
如何重命名图像?
要复制图像或重命名现有图像,只需从现有图像创建新标记或存储库。您可以使用docker标记命令执行此操作。
syntax/command: docker tag SOURCE_IMAGE[:TAG] TARGET_IMAGE[:TAG]
#=> docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
ubuntu-git latest c0aaaba33a60 18 hours ago 208MB
docker tag ubuntu-git:latest ubuntu-git:latest-new-tag
#=> docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
ubuntu-git latest c0aaaba33a60 18 hours ago 208MB
ubuntu-git latest-new-tag c0aaaba33a60 18 hours ago 208MB
如何重命名图像?
要复制图像或重命名现有图像,只需从现有图像创建新标记或存储库。您可以使用docker标记命令执行此操作。
syntax/command: docker tag SOURCE_IMAGE[:TAG] TARGET_IMAGE[:TAG]
#=> docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
ubuntu-git latest c0aaaba33a60 18 hours ago 208MB
docker tag ubuntu-git:latest ubuntu-git:latest-new-tag
#=> docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
ubuntu-git latest c0aaaba33a60 18 hours ago 208MB
ubuntu-git latest-new-tag c0aaaba33a60 18 hours ago 208MB