spec:
output:
to:
kind: "ImageStreamTag"
name: "sample-image:latest"
Use the following sections for an overview of and instructions for managing build output.
Builds that use the
Docker
or
Source-to-Image (s2i)
strategy result in the creation of a
new container image. The image is then pushed to the container image registry
specified in the output
section of the Build
specification.
If the output kind is ImageStreamTag
, then the image will be pushed to the
integrated OpenShift Container Platform registry and tagged in the specified imagestream. If
the output is of type DockerImage
, then the name of the output reference
will be used as a Docker push specification. The specification may contain a
registry or will default to DockerHub if no registry is specified. If the output
section of the build specification is empty, then the image will not be pushed
at the end of the build.
spec:
output:
to:
kind: "ImageStreamTag"
name: "sample-image:latest"
spec:
output:
to:
kind: "DockerImage"
name: "my-registry.mycompany.com:5000/myimages/myimage:tag"
Docker
and
Source-to-Image (s2i)
strategy builds set the following environment variables
on output images:
Variable | Description |
---|---|
|
Name of the build |
|
Namespace of the build |
|
The source URL of the build |
|
The Git reference used in the build |
|
Source commit used in the build |
Additionally, any user-defined environment variable, for example those
configured with
s2i
]
or Docker
strategy options, will also be part of the output image environment variable
list.
Docker
and
Source-to-Image (s2i)
builds set the following labels on output images:
Label | Description |
---|---|
|
Author of the source commit used in the build |
|
Date of the source commit used in the build |
|
Hash of the source commit used in the build |
|
Message of the source commit used in the build |
|
Branch or reference specified in the source |
|
Source URL for the build |
You can also use the BuildConfig.spec.output.imageLabels
field to specify a
list of custom labels that will be applied to each image built from the
BuildConfig
.
spec:
output:
to:
kind: "ImageStreamTag"
name: "my-image:latest"
imageLabels:
- name: "vendor"
value: "MyCompany"
- name: "authoritative-source-url"
value: "registry.mycompany.com"