An imagestream in {product-title} comprises zero or more container images identified by tags.
There are different types of tags available. The default behavior uses a permanent tag, which points to a specific image in time. If the _permanent_tag is in use and the source changes, the tag does not change for the destination.
A tracking tag means the destination tag’s metadata is updated during the import of the source tag.
-
You can add tags to an imagestream using the
oc tag
command:$ oc tag <source> <destination>
For example, to configure the
ruby
imagestreamsstatic-2.0
tag to always refer to the current image for theruby
imagestreams2.0
tag:$ oc tag ruby:2.0 ruby:static-2.0
This creates a new imagestreamtag named
static-2.0
in theruby
imagestream. The new tag directly references the image id that theruby:2.0
imagestreamtag pointed to at the timeoc tag
was run, and the image it points to never changes. -
To ensure the destination tag is updated whenever the source tag changes, use the
--alias=true
flag:$ oc tag --alias=true <source> <destination>
Note
|
Use a tracking tag for creating permanent aliases, for example, |
-
You can also add the
--scheduled=true
flag to have the destination tag be refreshed, or re-imported, periodically. The period is configured globally at the system level. -
The
--reference
flag creates an imagestreamtag that is not imported. The tag points to the source location, permanently.If you want to instruct OpenShift to always fetch the tagged image from the integrated registry, use
--reference-policy=local
. The registry uses the pull-through feature to serve the image to the client. By default, the image blobs are mirrored locally by the registry. As a result, they can be pulled more quickly the next time they are needed. The flag also allows for pulling from insecure registries without a need to supply--insecure-registry
to the container runtime as long as the imagestream has an insecure annotation or the tag has an insecure import policy.