4-Docker命令之docker tag

1.docker tag介绍

docker tag命令是用来给docker镜像打标签

2.docker tag用法

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

[root@centos79 ~]# docker tag --help

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

Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE

Aliases:
  docker image tag, docker tag
[root@centos79 ~]# 

3.实例

3.1.docker镜像打标签

命令:

docker tag nginx:latest nginx:1.0

[root@centos79 ~]# docker images | grep nginx
nginx                                latest        605c77e624dd   23 months ago   141MB
[root@centos79 ~]# docker tag nginx:latest nginx:1.0
[root@centos79 ~]# docker images | grep nginx
nginx                                1.0           605c77e624dd   23 months ago   141MB
nginx                                latest        605c77e624dd   23 months ago   141MB
[root@centos79 ~]# 

猜你喜欢

转载自blog.csdn.net/z19861216/article/details/134806740