docker tag 标记本地镜像,可用于更改名称
docker tag old-image[:old-tag] new-image[:new-tag]
[root@VM~]# docker tag --help
Usage: docker tag SOURCE_IMAGE[:TAG] TARGET_IMAGE[:TAG]
Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
docker tag 执行后,原名称的镜像还在,原名称和新名称的镜像,其ImageID镜像id是同一个。说明他们还是同一个镜像。
[root@VM-0-9-centos ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
lib/openjdk8 latest 5dac8d9399eb 2 days ago 107MB
winwinwang/openjdk8-zc latest 5dac8d9399eb 2 days ago 107MB