This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.6.7. Working with image streams
The following sections describe how to use image streams and image stream tags.
6.7.1. Getting information about image streams 复制链接链接已复制到粘贴板!
You can get general information about the image stream and detailed information about all the tags it is pointing to.
Procedure
Get general information about the image stream and detailed information about all the tags it is pointing to:
oc describe is/<image-name>
$ oc describe is/<image-name>Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example:
oc describe is/python
$ oc describe is/pythonCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Get all the information available about particular image stream tag:
oc describe istag/<image-stream>:<tag-name>
$ oc describe istag/<image-stream>:<tag-name>Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example:
oc describe istag/python:latest
$ oc describe istag/python:latestCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
More information is output than shown.
6.7.2. Adding tags to an image stream 复制链接链接已复制到粘贴板!
You can add additional tags to image streams.
Procedure
Add a tag that points to one of the existing tags by using the `oc tag`command:
oc tag <image-name:tag1> <image-name:tag2>
$ oc tag <image-name:tag1> <image-name:tag2>Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example:
oc tag python:3.5 python:latest
$ oc tag python:3.5 python:latestCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Tag python:latest set to python@sha256:49c18358df82f4577386404991c51a9559f243e0b1bdc366df25.
Tag python:latest set to python@sha256:49c18358df82f4577386404991c51a9559f243e0b1bdc366df25.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Confirm the image stream has two tags, one,
3.5, pointing at the external container image and another tag,latest, pointing to the same image because it was created based on the first tag.oc describe is/python
$ oc describe is/pythonCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
6.7.3. Adding tags for an external image 复制链接链接已复制到粘贴板!
You can add tags for external images.
Procedure
Add tags pointing to internal or external images, by using the
oc tagcommand for all tag-related operations:oc tag <repository/image> <image-name:tag>
$ oc tag <repository/image> <image-name:tag>Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example, this command maps the
docker.io/python:3.6.0image to the3.6tag in thepythonimage stream.oc tag docker.io/python:3.6.0 python:3.6
$ oc tag docker.io/python:3.6.0 python:3.6Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Tag python:3.6 set to docker.io/python:3.6.0.
Tag python:3.6 set to docker.io/python:3.6.0.Copy to Clipboard Copied! Toggle word wrap Toggle overflow If the external image is secured, you must create a secret with credentials for accessing that registry.
6.7.4. Updating image stream tags 复制链接链接已复制到粘贴板!
You can update a tag to reflect another tag in an image stream.
Procedure
Update a tag:
oc tag <image-name:tag> <image-name:latest>
$ oc tag <image-name:tag> <image-name:latest>Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example, the following updates the
latesttag to reflect the3.6tag in an image stream:oc tag python:3.6 python:latest
$ oc tag python:3.6 python:latestCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Tag python:latest set to python@sha256:438208801c4806548460b27bd1fbcb7bb188273d13871ab43f.
Tag python:latest set to python@sha256:438208801c4806548460b27bd1fbcb7bb188273d13871ab43f.Copy to Clipboard Copied! Toggle word wrap Toggle overflow
6.7.5. Removing image stream tags 复制链接链接已复制到粘贴板!
You can remove old tags from an image stream.
Procedure
Remove old tags from an image stream:
oc tag -d <image-name:tag>
$ oc tag -d <image-name:tag>Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example:
oc tag -d python:3.5
$ oc tag -d python:3.5Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Deleted tag default/python:3.5.
Deleted tag default/python:3.5.Copy to Clipboard Copied! Toggle word wrap Toggle overflow
When working with an external container image registry, to periodically re-import an image, for example to get latest security updates, you can use the --scheduled flag.
Procedure
Schedule importing images:
oc tag <repository/image> <image-name:tag> --scheduled
$ oc tag <repository/image> <image-name:tag> --scheduledCopy to Clipboard Copied! Toggle word wrap Toggle overflow For example:
oc tag docker.io/python:3.6.0 python:3.6 --scheduled
$ oc tag docker.io/python:3.6.0 python:3.6 --scheduledCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Tag python:3.6 set to import docker.io/python:3.6.0 periodically.
Tag python:3.6 set to import docker.io/python:3.6.0 periodically.Copy to Clipboard Copied! Toggle word wrap Toggle overflow This command causes OpenShift Container Platform to periodically update this particular image stream tag. This period is a cluster-wide setting set to 15 minutes by default.
Remove the periodic check, re-run above command but omit the
--scheduledflag. This release_notes its behavior to default.oc tag <repositiory/image> <image-name:tag>
$ oc tag <repositiory/image> <image-name:tag>Copy to Clipboard Copied! Toggle word wrap Toggle overflow