Home >Operation and Maintenance >Docker >What is the tag of docker?
In docker, tag is a command used to label an image; the tag command can mark a local image and classify it into a certain warehouse. The syntax is "docker tag [OPTIONS] IMAGE[:TAG ] [REGISTRYHOST/][USERNAME/]NAME[:TAG]".
The operating environment of this tutorial: linux7.3 system, docker version 19.03, Dell G3 computer.
docker tag: Mark the local image and classify it into a certain warehouse.
docker tag is used to tag the image. The syntax is as follows:
Syntax
docker tag [OPTIONS] IMAGE[:TAG] [REGISTRYHOST/][USERNAME/]NAME[:TAG]
The example is as follows:
Mark the image ubuntu:15.10 It is the runoob/ubuntu:v3 mirror.
root@runoob:~# docker tag ubuntu:15.10 runoob/ubuntu:v3 root@runoob:~# docker images runoob/ubuntu:v3 REPOSITORY TAG IMAGE ID CREATED SIZE runoob/ubuntu v3 4e3b13c8a266 3 months ago 136.3 MB
The example is as follows:
For example, I now have a centos image:
I develop centos and developed For the first version, I can tag this version. After tagging, a new image will be generated:
I continued to develop centos and developed the second version, continue to label:
and so on, label each version developed. If I want to roll back the version in the future, I can use the image with the specified label. Create a container:
[root@localhost ~]$ docker run -itd centos:v1
Recommended learning: "docker video tutorial"
The above is the detailed content of What is the tag of docker?. For more information, please follow other related articles on the PHP Chinese website!