-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Makes changes to image books as a result of ADV errors #103786
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,22 +5,22 @@ | |
| [id="images-add-tags-to-imagestreams_{context}"] | ||
| = Adding tags to image streams | ||
|
|
||
| An image stream in {product-title} comprises zero or more container images identified by tags. | ||
| [role="_abstract"] | ||
| You can add tags to image streams using the `oc tag` command. | ||
| You can add tags to organize images and create aliases for specific versions. | ||
|
|
||
| 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. | ||
| An image stream 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 that the destination tag's metadata is updated during the import of the source tag. | ||
|
|
||
| .Procedure | ||
|
|
||
| * You can add tags to an image stream using the `oc tag` command: | ||
| * Add a tag to an image stream by entering the following command. The default behavior creates a Permanent Tag that is pinned to an image ID: | ||
| + | ||
| [source,terminal] | ||
| ---- | ||
| $ oc tag <source> <destination> | ||
| $ oc tag <source_reference> <destination_image_stream>:<destination_tag> | ||
| ---- | ||
| + | ||
| For example, to configure the `ruby` image stream `static-2.0` tag to always refer to the current image for the `ruby` image stream `2.0` tag: | ||
| For example, to configure the `ruby` image stream `static-2.0` tag to always refer to the specific image that the `ruby:2.0` tag points to right now, enter the following command: | ||
| + | ||
| [source,terminal] | ||
| ---- | ||
|
|
@@ -29,22 +29,35 @@ $ oc tag ruby:2.0 ruby:static-2.0 | |
| + | ||
| This creates a new image stream tag named `static-2.0` in the `ruby` image stream. The new tag directly references the image id that the `ruby:2.0` image stream tag pointed to at the time `oc tag` was run, and the image it points to never changes. | ||
|
|
||
| * To ensure the destination tag is updated when the source tag changes, use the `--alias=true` flag: | ||
| * Use the `--alias=true` flag to create a Tracking Tag. This ensures the destination tag automatically updates (tracks) when the source tag changes to point to a new image. For example, to ensure that the `ruby:latest` tag always reflects whatever image is currently tagged as `ruby:2.0`, enter the following command: | ||
| + | ||
| [source,terminal] | ||
| ---- | ||
| $ oc tag --alias=true <source> <destination> | ||
| $ oc tag --alias=true ruby:2.0 ruby:latest | ||
| ---- | ||
|
|
||
| + | ||
| [NOTE] | ||
| ==== | ||
| Use a tracking tag for creating permanent aliases, for example, `latest` or `stable`. The tag only works correctly within a single image stream. Trying to create a cross-image stream alias produces an error. | ||
| A Tracking Tag created with `--alias=true` automatically updates its image ID whenever the source tag changes. Use tracking tags for creating common, long-lived aliases, such as latest or stable. This tracking behavior only works correctly within a single image stream. Trying to create a cross-image stream alias produces an error. | ||
| ==== | ||
|
|
||
| * 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. | ||
| * Optional: Use the `--scheduled=true` flag to have the destination tag be refreshed, or re-imported, periodically. The period is configured globally at the system level. For example: | ||
| + | ||
| [source,terminal] | ||
| ---- | ||
| $ oc tag <source_reference> <destination_image_stream>:<destination_tag> --scheduled=true | ||
| ---- | ||
|
|
||
| * The `--reference` flag creates an image stream tag that is not imported. The tag points to the source location, permanently. | ||
| * Optional: Use the `--reference` flag to create an image stream tag that is not imported. The tag permanently points to the source location, regardless of changes to the source image. For example: | ||
| + | ||
| If you want to instruct {product-title} 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 image stream has an insecure annotation or the tag has an insecure import policy. | ||
| [source,terminal] | ||
| ---- | ||
| $ oc tag <source_reference> <destination_image_stream>:<destination_tag> --reference | ||
| ---- | ||
|
|
||
| * Optional: Use the `--reference-policy=local` flag to instruct {product-title} to always fetch the tagged image from the integrated registry. 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 image stream has an insecure annotation or the tag has an insecure import policy. For example: | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤖 [error] RedHat.TermsErrors: Use 'if' or 'provided that' rather than 'as long as'. For more information, see RedHat.TermsErrors. |
||
| + | ||
| [source,terminal] | ||
| ---- | ||
| $ oc tag <source_reference> <destination_image_stream>:<destination_tag> --reference-policy=local | ||
| ---- | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| // Module included in the following assemblies: | ||
| // * openshift_images/tagging-images | ||
|
|
||
| :_mod-docs-content-type: REFERENCE | ||
| [id="images-imagestream-reference-types_{context}"] | ||
| = Understanding image stream reference types | ||
|
|
||
| [role="_abstract"] | ||
| Image streams in {product-title} allow you to reference container images using different reference types. These reference types define which specific image version your builds and deployments utilize. | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤖 [error] RedHat.TermsErrors: Use 'use' rather than 'utilize'. For more information, see RedHat.TermsErrors. |
||
|
|
||
| `ImageStreamImage` objects are automatically created in {product-title} when you import or tag an image into the image stream. You never have to explicitly define an `ImageStreamImage` object in any image stream definition that you use to create image streams. | ||
|
|
||
| [NOTE] | ||
| ==== | ||
| Example image stream definitions often contain definitions of `ImageStreamTag` and references to `DockerImage`, but never contain definitions of `ImageStreamImage`. | ||
| ==== | ||
|
|
||
| .Imagestream reference types | ||
| [width="50%",options="header"] | ||
| |=== | ||
| | Reference Type | Description | Syntax Examples | | ||
| | `ImageStreamTag` | References or retrieves an image for a given image stream and human-readable tag. | `image_stream_name:tag` | ||
| | `ImageStreamImage` | References or retrieves an image for a given image stream and immutable SHA ID (digest). | `image_stream_name@id` | ||
| | `DockerImage` | References or retrieves an image from an external registry. Uses the standard `docker pull` specification. | `openshift/ruby-20-centos7:2.0`<br>`registry.redhat.io/rhel7:latest`<br>`centos/ruby-22-centos7@sha256:3a335d7d...` | ||
| |=== | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,65 +3,75 @@ | |
|
|
||
| :_mod-docs-content-type: PROCEDURE | ||
| [id="images-referencing-images-imagestreams_{context}"] | ||
| = Referencing images in imagestreams | ||
| = Using image stream reference syntax | ||
|
|
||
| You can use tags to reference images in image streams using the following reference types. | ||
|
|
||
| .Imagestream reference types | ||
| [width="50%",options="header"] | ||
| |=== | ||
| |Reference type |Description | ||
|
|
||
| |`ImageStreamTag` | ||
| |An `ImageStreamTag` is used to reference or retrieve an image for a given image stream and tag. | ||
|
|
||
| |`ImageStreamImage` | ||
| |An `ImageStreamImage` is used to reference or retrieve an image for a given image stream and image `sha` ID. | ||
|
|
||
| |`DockerImage` | ||
| |A `DockerImage` is used to reference or retrieve an image for a given external registry. It uses standard Docker `pull specification` for its name. | ||
| |=== | ||
|
|
||
| When viewing example image stream definitions you may notice they contain definitions of `ImageStreamTag` and references to `DockerImage`, but nothing related to `ImageStreamImage`. | ||
|
|
||
| This is because the `ImageStreamImage` objects are automatically created in {product-title} when you import or tag an image into the image stream. You should never have to explicitly define an `ImageStreamImage` object in any image stream definition that you use to create image streams. | ||
| [role="_abstract"] | ||
| To ensure your builds or deployments use the correct image, you must apply the appropriate reference syntax based on whether you are referencing an image stream, a tag, a specific ID, or an external registry. | ||
|
|
||
| .Procedure | ||
|
|
||
| * To reference an image for a given image stream and tag, use `ImageStreamTag`: | ||
| * To reference an image by a mutable tag (`ImageStreamTag`) from an image stream within your cluster, use the `<image_stream_name>:<tag>` format in your build or deployment configuration. For example: | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤖 [error] RedHat.TermsErrors: Use 'deployment' rather than 'deployment configuration'. For more information, see RedHat.TermsErrors.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤖 [error] Vale.Avoid: Avoid using 'deployment configuration'. |
||
| + | ||
| [source,yaml] | ||
| ---- | ||
| <image_stream_name>:<tag> | ||
| # ... | ||
| spec: | ||
| containers: | ||
| - name: my-app | ||
| image: <image_stream_name>:<tag> | ||
| ---- | ||
| + | ||
| -- | ||
| where: | ||
|
|
||
| * To reference an image for a given image stream and image `sha` ID, use `ImageStreamImage`: | ||
| `image`:: Specifies the image to use from the image stream. For example, `ruby:2.0`. | ||
| -- | ||
|
|
||
| * To reference a specific, immutable image ID, or digest, within an image stream, use the `<image_stream_name>@<image_id>` format in your build or deployment configuration. For example: | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤖 [error] RedHat.TermsErrors: Use 'deployment' rather than 'deployment configuration'. For more information, see RedHat.TermsErrors.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤖 [error] Vale.Avoid: Avoid using 'deployment configuration'. |
||
| + | ||
| [source,yaml] | ||
| ---- | ||
| <image_stream_name>@<id> | ||
| # ... | ||
| spec: | ||
| containers: | ||
| - name: my-app | ||
| image: <image_stream_name>@<image_id> | ||
| ---- | ||
| + | ||
| The `<id>` is an immutable identifier for a specific image, also called a | ||
| digest. | ||
| -- | ||
| where: | ||
|
|
||
| * To reference or retrieve an image for a given external registry, use `DockerImage`: | ||
| + | ||
| ---- | ||
| openshift/ruby-20-centos7:2.0 | ||
| ---- | ||
| `image`:: Specifies the image to use from the image stream. For example, `ruby@sha256:3a335d7d8a452970c5b4054ad7118ff134b3a6b50a2bb6d0c07c746e8986b28e`. | ||
| -- | ||
| + | ||
| [NOTE] | ||
| ==== | ||
| When no tag is specified, it is assumed the `latest` tag is used. | ||
| Using the image ID with the `@id` syntax ensures your configuration always uses the exact same image, even if the tag is later updated to point to a different image. | ||
| ==== | ||
|
|
||
| * To reference an image from an external registry by using the DockerImage format, use the standard Docker pull specification: `<registry>/<namespace>/<image_name>:<tag>`. For example: | ||
| + | ||
| You can also reference a third-party registry: | ||
| + | ||
| [source,yaml] | ||
| ---- | ||
| registry.redhat.io/rhel7:latest | ||
| # ... | ||
| spec: | ||
| source: | ||
| type: Dockerfile | ||
| strategy: | ||
| type: Docker | ||
| dockerStrategy: | ||
| from: | ||
| kind: DockerImage | ||
| name: <registry>/<namespace>/<image_name>:<tag> | ||
| ---- | ||
| + | ||
| Or an image with a digest: | ||
| -- | ||
| where: | ||
|
|
||
| `image`:: Specifies the image to use from the external registry. For example, `registry.redhat.io/rhel7:latest`. | ||
| -- | ||
| + | ||
| ---- | ||
| centos/ruby-22-centos7@sha256:3a335d7d8a452970c5b4054ad7118ff134b3a6b50a2bb6d0c07c746e8986b28e | ||
| ---- | ||
| [NOTE] | ||
| ==== | ||
| When no tag is specified in a `DockerImage` reference, the `latest` tag is assumed. | ||
| ==== | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤖 [error] RedHat.TermsErrors: Use 'now' rather than 'right now'. For more information, see RedHat.TermsErrors.