Home  >  Article  >  Operation and Maintenance  >  What is the tag of docker?

What is the tag of docker?

WBOY
WBOYOriginal
2022-07-08 16:19:207042browse

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]".

What is the tag of docker?

The operating environment of this tutorial: linux7.3 system, docker version 19.03, Dell G3 computer.

What is the tag of docker

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:

What is the tag of docker?

I develop centos and developed For the first version, I can tag this version. After tagging, a new image will be generated:

What is the tag of docker?

I continued to develop centos and developed the second version, continue to label:

What is the tag of docker?

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn