3.5.2.7.2. 在镜像流中添加额外标签
要添加指向其中一个现有标签的标签,您可以使用 oc tag
命令:
oc tag <image-name:tag> <image-name:tag>
例如:
$ oc tag python:3.5 python:latest
输出示例
Tag python:latest set to python@sha256:49c18358df82f4577386404991c51a9559f243e0b1bdc366df25.
使用 oc describe
命令确认镜像流有两个标签,一个(3.5
)指向外部容器镜像,另一个标签(latest
)指向同一镜像,因为它基于第一个标签创建。
$ oc describe is/python
输出示例
Name: python Namespace: default Created: 5 minutes ago Labels: <none> Annotations: openshift.io/image.dockerRepositoryCheck=2017-10-02T17:05:11Z Docker Pull Spec: docker-registry.default.svc:5000/default/python Image Lookup: local=false Unique Images: 1 Tags: 2 latest tagged from python@sha256:49c18358df82f4577386404991c51a9559f243e0b1bdc366df25 * centos/python-35-centos7@sha256:49c18358df82f4577386404991c51a9559f243e0b1bdc366df25 About a minute ago 3.5 tagged from centos/python-35-centos7 * centos/python-35-centos7@sha256:49c18358df82f4577386404991c51a9559f243e0b1bdc366df25 5 minutes ago