docker tag 镜像标签
最后更新于:2022-04-02 03:03:52
[TOC]
## docker tag
赋值并修改镜像名[标签]
## 语法
```
docker tag SOURCE_IMAGE[:TAG] TARGET_IMAGE[:TAG]
```
## 实例
### 给标记 id 打标签
```
$ docker tag 0e5574283393 fedora/httpd:version1.0
docker tag demo:v2 demo:v23
```
### 给名称打标签
```
> docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
nginx latest bc9a0695f571 7 days ago 133MB
> docker tag nginx nginx:3.0
> docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
nginx 3.0 bc9a0695f571 7 days ago 133MB
```
或带上斜线
```
> docker tag httpd fedora/httpd:version1.0
```
';