-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Built image digest is stored in the build status #3533
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1650,6 +1650,7 @@ This displays information such as: | |
* The build source | ||
* The strategy | ||
* The output destination | ||
* Digest of the image in destination registry | ||
* How the build was created | ||
|
||
If the build uses the Docker or Source strategy, the `oc describe` output also | ||
|
@@ -2432,7 +2433,7 @@ sample-build-3 Source Git@689d111 Completed 17 seconds ago 5s | |
[[build-output]] | ||
== Build Output | ||
|
||
Docker and Source builds result in the creation of a new container image. The image | ||
Docker and source builds result in the creation of a new container image. The image | ||
is then pushed to the registry specified in the `output` section of the | ||
`Build` specification. | ||
|
||
|
@@ -2448,28 +2449,30 @@ at the end of the build. | |
==== | ||
[source,yaml] | ||
---- | ||
output: | ||
to: | ||
kind: "ImageStreamTag" | ||
name: "sample-image:latest" | ||
spec: | ||
output: | ||
to: | ||
kind: "ImageStreamTag" | ||
name: "sample-image:latest" | ||
---- | ||
==== | ||
|
||
.Output to a Docker Push Specification | ||
==== | ||
[source,yaml] | ||
---- | ||
output: | ||
to: | ||
kind: "DockerImage" | ||
name: "my-registry.mycompany.com:5000/myimages/myimage:tag" | ||
spec: | ||
output: | ||
to: | ||
kind: "DockerImage" | ||
name: "my-registry.mycompany.com:5000/myimages/myimage:tag" | ||
---- | ||
==== | ||
|
||
[[output-image-environment-variables]] | ||
=== Output Image Environment Variables | ||
|
||
Docker and Source builds set the following environment variables on output | ||
Docker and source builds set the following environment variables on output | ||
images: | ||
|
||
[options="header"] | ||
|
@@ -2496,7 +2499,7 @@ images: | |
[[output-image-labels]] | ||
=== Output Image Labels | ||
|
||
Docker and Source builds set the following labels on output images: | ||
Docker and source builds set the following labels on output images: | ||
|
||
[options="header"] | ||
|=== | ||
|
@@ -2529,15 +2532,42 @@ list of custom labels that will be applied to each image built from the BuildCon | |
==== | ||
[source,yaml] | ||
---- | ||
output: | ||
to: | ||
kind: "ImageStreamTag" | ||
name: "my-image:latest" | ||
imageLabels: | ||
- name: "vendor" | ||
value: "MyCompany" | ||
- name: "authoritative-source-url" | ||
value: "registry.mycompany.com" | ||
spec: | ||
output: | ||
to: | ||
kind: "ImageStreamTag" | ||
name: "my-image:latest" | ||
imageLabels: | ||
- name: "vendor" | ||
value: "MyCompany" | ||
- name: "authoritative-source-url" | ||
value: "registry.mycompany.com" | ||
---- | ||
==== | ||
|
||
[[output-image-digest]] | ||
=== Output Image Digest | ||
|
||
Built images can be uniquely identified by their | ||
link:++https://docs.docker.com/registry/spec/api/#/content-digests++[digest], which can | ||
later be used to | ||
link:++https://docs.docker.com/engine/reference/commandline/pull/#/pull-an-image-by-digest-immutable-identifier++[pull the image] | ||
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. Same here. Please remove the ++ before and after the URL. |
||
regardless of its current tag. | ||
|
||
Docker and source builds store the digest in | ||
`Build.status.output.to.imageDigest` after the image is pushed to registry. | ||
The digest is computed by the registry. Therefore, it may not always be present | ||
(for example, when the registry did not return a digest, or when the builder | ||
image did not understand its format). | ||
|
||
.Built Image Digest After a Successful Push to the Registry | ||
==== | ||
[source,yaml] | ||
---- | ||
status: | ||
output: | ||
to: | ||
imageDigest: sha256:29f5d56d12684887bdfa50dcd29fc31eea4aaf4ad3bec43daf19026a7ce69912 | ||
---- | ||
==== | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Please remove the ++ before and after the URL
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.
Without ++ asciibinder mis-parses the URL, probably because it contains #. Is there another way to escape it?
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.
@mmilata Interesting. I've not seen that before. @adellape @vikram-redhat Do you know a workaround, or do you think the ++ can be accepted? Not sure if this will impact how the docs build. Thanks!
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.
@ahardin-rh I'm not sure of another workaround. I think only the Customer Portal build would potentially have an issue; worth checking with Lee on. @vikram-redhat Can you look into that?
I'd be inclined to merge this but mark for follow-up before it gets downstream.
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.
@vikram-redhat bump ^^
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.
@ahardin-rh - interesting. I haven't seen this issue before either. But from memory, if asciibinder is miss-parsing the URL due to the hash, you could just take the 'link' off. Can you try that and see if it fixes it?
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.
Ignore my previous comment. Discussed with Lee. He has suggested using $$ instead of ++.