Skip to main content

BuildConfig [build.openshift.io/v1]

Description
Build configurations define a build process for new container images. There are three types of builds possible - a container image build using a Dockerfile, a Source-to-Image build that uses a specially prepared base image that accepts source code that it can make runnable, and a custom build that can run // arbitrary container images as a base and accept the build parameters. Builds run on the cluster and on completion are pushed to the container image registry specified in the "output" section. A build can be triggered via a webhook, when the base image changes, or when a user manually requests a new build be // created. Each build created by a build configuration is numbered and refers back to its parent configuration. Multiple builds can be triggered at once. Builds that do not have "output" set can be used to test code or run a verification build. Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer).
Type
`object`
Required
  • spec

Specification​

PropertyTypeDescription
apiVersionstringAPIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
kindstringKind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
metadataObjectMetametadata is the standard object’s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
specobjectBuildConfigSpec describes when and how builds are created
statusobjectBuildConfigStatus contains current state of the build config object.

.spec​

Description
BuildConfigSpec describes when and how builds are created
Type
`object`
Required
  • strategy
PropertyTypeDescription
completionDeadlineSecondsintegercompletionDeadlineSeconds is an optional duration in seconds, counted from the time when a build pod gets scheduled in the system, that the build may be active on a node before the system actively tries to terminate the build; value must be positive integer
failedBuildsHistoryLimitintegerfailedBuildsHistoryLimit is the number of old failed builds to retain. When a BuildConfig is created, the 5 most recent failed builds are retained unless this value is set. If removed after the BuildConfig has been created, all failed builds are retained.
mountTrustedCAbooleanmountTrustedCA bind mounts the cluster’s trusted certificate authorities, as defined in the cluster’s proxy configuration, into the build. This lets processes within a build trust components signed by custom PKI certificate authorities, such as private artifact repositories and HTTPS proxies.
When this field is set to true, the contents of /etc/pki/ca-trust within the build are managed by the build container, and any changes to this directory or its subdirectories (for example - within a Dockerfile RUN instruction) are not persisted in the build’s output image.
nodeSelectorobject (string)nodeSelector is a selector which must be true for the build pod to fit on a node If nil, it can be overridden by default build nodeselector values for the cluster. If set to an empty map or a map with any values, default build nodeselector values are ignored.
outputobjectBuildOutput is input to a build strategy and describes the container image that the strategy should produce.
postCommitobjectA BuildPostCommitSpec holds a build post commit hook specification. The hook executes a command in a temporary container running the build output image, immediately after the last layer of the image is committed and before the image is pushed to a registry. The command is executed with the current working directory (PWD) set to the image’s WORKDIR.<br>The build will be marked as failed if the hook execution fails. It will fail if the script or command return a non-zero exit code, or if there is any other error related to starting the temporary container.<br>There are five different ways to configure the hook. As an example, all forms below are equivalent and will execute `rake test --verbose`.<br>1. Shell script:<br> "postCommit": { "script": "rake test --verbose", }<br> The above is a convenient form which is equivalent to:<br> "postCommit": { "command": ["/bin/sh", "-ic"], "args": ["rake test --verbose"] }<br>2. A command as the image entrypoint:<br> "postCommit": { "commit": ["rake", "test", "--verbose"] }<br> Command overrides the image entrypoint in the exec form, as documented in Docker: https://docs.docker.com/engine/reference/builder/#entrypoint.<br>3. Pass arguments to the default entrypoint:<br> "postCommit": { "args": ["rake", "test", "--verbose"] }<br> This form is only useful if the image entrypoint can handle arguments.<br>4. Shell script with arguments:<br> "postCommit": { "script": "rake test 1", "args": ["--verbose"] }
This form is useful if you need to pass arguments that would otherwise be hard to quote properly in the shell script. In the script, 0willbe"/bin/sh"and0 will be "/bin/sh" and 1, $2, etc, are the positional arguments from Args.
5. Command with arguments:
"postCommit": { "command": ["rake", "test"], "args": ["--verbose"] }
This form is equivalent to appending the arguments to the Command slice.
It is invalid to provide both Script and Command simultaneously. If none of the fields are specified, the hook is not executed.
resourcesResourceRequirementsresources computes resource requirements to execute the build.
revisionobjectSourceRevision is the revision or commit information from the source for the build
runPolicystringrunPolicy describes how the new build created from this build configuration will be scheduled for execution. This is optional, if not specified we default to "Serial".
serviceAccountstringserviceAccount is the name of the ServiceAccount to use to run the pod created by this build. The pod will be allowed to use secrets referenced by the ServiceAccount
sourceobjectBuildSource is the SCM used for the build.
strategyobjectBuildStrategy contains the details of how to perform a build.
successfulBuildsHistoryLimitintegersuccessfulBuildsHistoryLimit is the number of old successful builds to retain. When a BuildConfig is created, the 5 most recent successful builds are retained unless this value is set. If removed after the BuildConfig has been created, all successful builds are retained.
triggersarraytriggers determine how new Builds can be launched from a BuildConfig. If no triggers are defined, a new build can only occur as a result of an explicit client build creation.
triggers[]objectBuildTriggerPolicy describes a policy for a single trigger that results in a new Build.

.spec.output​

Description
BuildOutput is input to a build strategy and describes the container image that the strategy should produce.
Type
`object`
PropertyTypeDescription
imageLabelsarrayimageLabels define a list of labels that are applied to the resulting image. If there are multiple labels with the same name then the last one in the list is used.
imageLabels[]objectImageLabel represents a label applied to the resulting image.
pushSecretLocalObjectReferencepushSecret is the name of a Secret that would be used for setting up the authentication for executing the Docker push to authentication enabled Docker Registry (or Docker Hub).
toObjectReferenceto defines an optional location to push the output of this build to. Kind must be one of 'ImageStreamTag' or 'DockerImage'. This value will be used to look up a container image repository to push to. In the case of an ImageStreamTag, the ImageStreamTag will be looked for in the namespace of the build unless Namespace is specified.

.spec.output.imageLabels​

Description
imageLabels define a list of labels that are applied to the resulting image. If there are multiple labels with the same name then the last one in the list is used.
Type
`array`

.spec.output.imageLabels[]​

Description
ImageLabel represents a label applied to the resulting image.
Type
`object`
Required
  • name
PropertyTypeDescription
namestringname defines the name of the label. It must have non-zero length.
valuestringvalue defines the literal value of the label.

.spec.postCommit​

Description
A BuildPostCommitSpec holds a build post commit hook specification. The hook executes a command in a temporary container running the build output image, immediately after the last layer of the image is committed and before the image is pushed to a registry. The command is executed with the current working directory ($PWD) set to the image’s WORKDIR. The build will be marked as failed if the hook execution fails. It will fail if the script or command return a non-zero exit code, or if there is any other error related to starting the temporary container. There are five different ways to configure the hook. As an example, all forms below are equivalent and will execute rake test --verbose.
  1. Shell script: "postCommit": { "script": "rake test --verbose", }
The above is a convenient form which is equivalent to: "postCommit": { "command": ["/bin/sh", "-ic"], "args": ["rake test --verbose"] } 2. A command as the image entrypoint: "postCommit": { "commit": ["rake", "test", "--verbose"] } Command overrides the image entrypoint in the exec form, as documented in Docker: https://docs.docker.com/engine/reference/builder/#entrypoint. 3. Pass arguments to the default entrypoint:
"postCommit": {
"args": ["rake", "test", "--verbose"]
}

This form is only useful if the image entrypoint can handle arguments.
  1. Shell script with arguments: "postCommit": { "script": "rake test $1", "args": ["--verbose"] }
This form is useful if you need to pass arguments that would otherwise be hard to quote properly in the shell script. In the script, 0willbe"/bin/sh"and0 will be "/bin/sh" and 1, $2, etc, are the positional arguments from Args. 5. Command with arguments: "postCommit": { "command": ["rake", "test"], "args": ["--verbose"] } This form is equivalent to appending the arguments to the Command slice. It is invalid to provide both Script and Command simultaneously. If none of the fields are specified, the hook is not executed.
Type
`object`
PropertyTypeDescription
argsarray (string)args is a list of arguments that are provided to either Command, Script or the container image’s default entrypoint. The arguments are placed immediately after the command to be run.
commandarray (string)command is the command to run. It may not be specified with Script. This might be needed if the image doesn’t have /bin/sh, or if you do not want to use a shell. In all other cases, using Script might be more convenient.
scriptstringscript is a shell script to be run with /bin/sh -ic. It may not be specified with Command. Use Script when a shell script is appropriate to execute the post build hook, for example for running unit tests with rake test. If you need control over the image entrypoint, or if the image does not have /bin/sh, use Command and/or Args. The -i flag is needed to support CentOS and RHEL images that use Software Collections (SCL), in order to have the appropriate collections enabled in the shell. E.g., in the Ruby image, this is necessary to make ruby, bundle and other binaries available in the PATH.

.spec.revision​

Description
SourceRevision is the revision or commit information from the source for the build
Type
`object`
Required
  • type
PropertyTypeDescription
gitobjectGitSourceRevision is the commit information from a git source for a build
typestringtype of the build source, may be one of 'Source', 'Dockerfile', 'Binary', or 'Images'

.spec.revision.git​

Description
GitSourceRevision is the commit information from a git source for a build
Type
`object`
PropertyTypeDescription
authorobjectSourceControlUser defines the identity of a user of source control
commitstringcommit is the commit hash identifying a specific commit
committerobjectSourceControlUser defines the identity of a user of source control
messagestringmessage is the description of a specific commit

.spec.revision.git.author​

Description
SourceControlUser defines the identity of a user of source control
Type
`object`
PropertyTypeDescription
emailstringemail of the source control user
namestringname of the source control user

.spec.revision.git.committer​

Description
SourceControlUser defines the identity of a user of source control
Type
`object`
PropertyTypeDescription
emailstringemail of the source control user
namestringname of the source control user

.spec.source​

Description
BuildSource is the SCM used for the build.
Type
`object`
PropertyTypeDescription
binaryobjectBinaryBuildSource describes a binary file to be used for the Docker and Source build strategies, where the file will be extracted and used as the build source.
configMapsarrayconfigMaps represents a list of configMaps and their destinations that will be used for the build.
configMaps[]objectConfigMapBuildSource describes a configmap and its destination directory that will be used only at the build time. The content of the configmap referenced here will be copied into the destination directory instead of mounting.
contextDirstringcontextDir specifies the sub-directory where the source code for the application exists. This allows to have buildable sources in directory other than root of repository.
dockerfilestringdockerfile is the raw contents of a Dockerfile which should be built. When this option is specified, the FROM may be modified based on your strategy base image and additional ENV stanzas from your strategy environment will be added after the FROM, but before the rest of your Dockerfile stanzas. The Dockerfile source type may be used with other options like git - in those cases the Git repo will have any innate Dockerfile replaced in the context dir.
gitobjectGitBuildSource defines the parameters of a Git SCM
imagesarrayimages describes a set of images to be used to provide source for the build
images[]objectImageSource is used to describe build source that will be extracted from an image or used during a multi stage build. A reference of type ImageStreamTag, ImageStreamImage or DockerImage may be used. A pull secret can be specified to pull the image from an external registry or override the default service account secret if pulling from the internal registry. Image sources can either be used to extract content from an image and place it into the build context along with the repository source, or used directly during a multi-stage container image build to allow content to be copied without overwriting the contents of the repository source (see the 'paths' and 'as' fields).
secretsarraysecrets represents a list of secrets and their destinations that will be used only for the build.
secrets[]objectSecretBuildSource describes a secret and its destination directory that will be used only at the build time. The content of the secret referenced here will be copied into the destination directory instead of mounting.
sourceSecretLocalObjectReferencesourceSecret is the name of a Secret that would be used for setting up the authentication for cloning private repository. The secret contains valid credentials for remote repository, where the data’s key represent the authentication method to be used and value is the base64 encoded credentials. Supported auth methods are: ssh-privatekey.
typestringtype of build input to accept

.spec.source.binary​

Description
BinaryBuildSource describes a binary file to be used for the Docker and Source build strategies, where the file will be extracted and used as the build source.
Type
`object`
PropertyTypeDescription
asFilestringasFile indicates that the provided binary input should be considered a single file within the build input. For example, specifying "webapp.war" would place the provided binary as /webapp.war for the builder. If left empty, the Docker and Source build strategies assume this file is a zip, tar, or tar.gz file and extract it as the source. The custom strategy receives this binary as standard input. This filename may not contain slashes or be '..' or '.'.

.spec.source.configMaps​

Description
configMaps represents a list of configMaps and their destinations that will be used for the build.
Type
`array`

.spec.source.configMaps[]​

Description
ConfigMapBuildSource describes a configmap and its destination directory that will be used only at the build time. The content of the configmap referenced here will be copied into the destination directory instead of mounting.
Type
`object`
Required
  • configMap
PropertyTypeDescription
configMapLocalObjectReferenceconfigMap is a reference to an existing configmap that you want to use in your build.
destinationDirstringdestinationDir is the directory where the files from the configmap should be available for the build time. For the Source build strategy, these will be injected into a container where the assemble script runs. For the container image build strategy, these will be copied into the build directory, where the Dockerfile is located, so users can ADD or COPY them during container image build.

.spec.source.git​

Description
GitBuildSource defines the parameters of a Git SCM
Type
`object`
Required
  • uri
PropertyTypeDescription
httpProxystringhttpProxy is a proxy used to reach the git repository over http
httpsProxystringhttpsProxy is a proxy used to reach the git repository over https
noProxystringnoProxy is the list of domains for which the proxy should not be used
refstringref is the branch/tag/ref to build.
uristringuri points to the source that will be built. The structure of the source will depend on the type of build to run

.spec.source.images​

Description
images describes a set of images to be used to provide source for the build
Type
`array`

.spec.source.images[]​

Description
ImageSource is used to describe build source that will be extracted from an image or used during a multi stage build. A reference of type ImageStreamTag, ImageStreamImage or DockerImage may be used. A pull secret can be specified to pull the image from an external registry or override the default service account secret if pulling from the internal registry. Image sources can either be used to extract content from an image and place it into the build context along with the repository source, or used directly during a multi-stage container image build to allow content to be copied without overwriting the contents of the repository source (see the 'paths' and 'as' fields).
Type
`object`
Required
  • from
PropertyTypeDescription
asarray (string)A list of image names that this source will be used in place of during a multi-stage container image build. For instance, a Dockerfile that uses "COPY --from=nginx:latest" will first check for an image source that has "nginx:latest" in this field before attempting to pull directly. If the Dockerfile does not reference an image source it is ignored. This field and paths may both be set, in which case the contents will be used twice.
fromObjectReferencefrom is a reference to an ImageStreamTag, ImageStreamImage, or DockerImage to copy source from.
pathsarraypaths is a list of source and destination paths to copy from the image. This content will be copied into the build context prior to starting the build. If no paths are set, the build context will not be altered.
paths[]objectImageSourcePath describes a path to be copied from a source image and its destination within the build directory.
pullSecretLocalObjectReferencepullSecret is a reference to a secret to be used to pull the image from a registry If the image is pulled from the OpenShift registry, this field does not need to be set.

.spec.source.images[].paths​

Description
paths is a list of source and destination paths to copy from the image. This content will be copied into the build context prior to starting the build. If no paths are set, the build context will not be altered.
Type
`array`

.spec.source.images[].paths[]​

Description
ImageSourcePath describes a path to be copied from a source image and its destination within the build directory.
Type
`object`
Required
  • sourcePath
  • destinationDir
PropertyTypeDescription
destinationDirstringdestinationDir is the relative directory within the build directory where files copied from the image are placed.
sourcePathstringsourcePath is the absolute path of the file or directory inside the image to copy to the build directory. If the source path ends in /. then the content of the directory will be copied, but the directory itself will not be created at the destination.

.spec.source.secrets​

Description
secrets represents a list of secrets and their destinations that will be used only for the build.
Type
`array`

.spec.source.secrets[]​

Description
SecretBuildSource describes a secret and its destination directory that will be used only at the build time. The content of the secret referenced here will be copied into the destination directory instead of mounting.
Type
`object`
Required
  • secret
PropertyTypeDescription
destinationDirstringdestinationDir is the directory where the files from the secret should be available for the build time. For the Source build strategy, these will be injected into a container where the assemble script runs. Later, when the script finishes, all files injected will be truncated to zero length. For the container image build strategy, these will be copied into the build directory, where the Dockerfile is located, so users can ADD or COPY them during container image build.
secretLocalObjectReferencesecret is a reference to an existing secret that you want to use in your build.

.spec.strategy​

Description
BuildStrategy contains the details of how to perform a build.
Type
`object`
PropertyTypeDescription
customStrategyobjectCustomBuildStrategy defines input parameters specific to Custom build.
dockerStrategyobjectDockerBuildStrategy defines input parameters specific to container image build.
jenkinsPipelineStrategyobjectJenkinsPipelineBuildStrategy holds parameters specific to a Jenkins Pipeline build. Deprecated: use OpenShift Pipelines
sourceStrategyobjectSourceBuildStrategy defines input parameters specific to an Source build.
typestringtype is the kind of build strategy.

.spec.strategy.customStrategy​

Description
CustomBuildStrategy defines input parameters specific to Custom build.
Type
`object`
Required
  • from
PropertyTypeDescription
buildAPIVersionstringbuildAPIVersion is the requested API version for the Build object serialized and passed to the custom builder
envarray (EnvVar)env contains additional environment variables you want to pass into a builder container.
exposeDockerSocketbooleanexposeDockerSocket will allow running Docker commands (and build container images) from inside the container.
forcePullbooleanforcePull describes if the controller should configure the build pod to always pull the images for the builder or only pull if it is not present locally
fromObjectReferencefrom is reference to an DockerImage, ImageStreamTag, or ImageStreamImage from which the container image should be pulled
pullSecretLocalObjectReferencepullSecret is the name of a Secret that would be used for setting up the authentication for pulling the container images from the private Docker registries
secretsarraysecrets is a list of additional secrets that will be included in the build pod
secrets[]objectSecretSpec specifies a secret to be included in a build pod and its corresponding mount point

.spec.strategy.customStrategy.secrets​

Description
secrets is a list of additional secrets that will be included in the build pod
Type
`array`

.spec.strategy.customStrategy.secrets[]​

Description
SecretSpec specifies a secret to be included in a build pod and its corresponding mount point
Type
`object`
Required
  • secretSource
  • mountPath
PropertyTypeDescription
mountPathstringmountPath is the path at which to mount the secret
secretSourceLocalObjectReferencesecretSource is a reference to the secret

.spec.strategy.dockerStrategy​

Description
DockerBuildStrategy defines input parameters specific to container image build.
Type
`object`
PropertyTypeDescription
buildArgsarray (EnvVar)buildArgs contains build arguments that will be resolved in the Dockerfile. See https://docs.docker.com/engine/reference/builder/#/arg for more details. NOTE: Only the 'name' and 'value' fields are supported. Any settings on the 'valueFrom' field are ignored.
dockerfilePathstringdockerfilePath is the path of the Dockerfile that will be used to build the container image, relative to the root of the context (contextDir). Defaults to Dockerfile if unset.
envarray (EnvVar)env contains additional environment variables you want to pass into a builder container.
forcePullbooleanforcePull describes if the builder should pull the images from registry prior to building.
fromObjectReferencefrom is a reference to an DockerImage, ImageStreamTag, or ImageStreamImage which overrides the FROM image in the Dockerfile for the build. If the Dockerfile uses multi-stage builds, this will replace the image in the last FROM directive of the file.
imageOptimizationPolicystringimageOptimizationPolicy describes what optimizations the system can use when building images to reduce the final size or time spent building the image. The default policy is 'None' which means the final build image will be equivalent to an image created by the container image build API. The experimental policy 'SkipLayers' will avoid commiting new layers in between each image step, and will fail if the Dockerfile cannot provide compatibility with the 'None' policy. An additional experimental policy 'SkipLayersAndWarn' is the same as 'SkipLayers' but simply warns if compatibility cannot be preserved.
noCachebooleannoCache if set to true indicates that the container image build must be executed with the --no-cache=true flag
pullSecretLocalObjectReferencepullSecret is the name of a Secret that would be used for setting up the authentication for pulling the container images from the private Docker registries
volumesarrayvolumes is a list of input volumes that can be mounted into the builds runtime environment. Only a subset of Kubernetes Volume sources are supported by builds. More info: https://kubernetes.io/docs/concepts/storage/volumes
volumes[]objectBuildVolume describes a volume that is made available to build pods, such that it can be mounted into buildah’s runtime environment. Only a subset of Kubernetes Volume sources are supported.

.spec.strategy.dockerStrategy.volumes​

Description
volumes is a list of input volumes that can be mounted into the builds runtime environment. Only a subset of Kubernetes Volume sources are supported by builds. More info: https://kubernetes.io/docs/concepts/storage/volumes
Type
`array`

.spec.strategy.dockerStrategy.volumes[]​

Description
BuildVolume describes a volume that is made available to build pods, such that it can be mounted into buildah’s runtime environment. Only a subset of Kubernetes Volume sources are supported.
Type
`object`
Required
  • name
  • source
  • mounts
PropertyTypeDescription
mountsarraymounts represents the location of the volume in the image build container
mounts[]objectBuildVolumeMount describes the mounting of a Volume within buildah’s runtime environment.
namestringname is a unique identifier for this BuildVolume. It must conform to the Kubernetes DNS label standard and be unique within the pod. Names that collide with those added by the build controller will result in a failed build with an error message detailing which name caused the error. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
sourceobjectBuildVolumeSource represents the source of a volume to mount Only one of its supported types may be specified at any given time.

.spec.strategy.dockerStrategy.volumes[].mounts​

Description
mounts represents the location of the volume in the image build container
Type
`array`

.spec.strategy.dockerStrategy.volumes[].mounts[]​

Description
BuildVolumeMount describes the mounting of a Volume within buildah’s runtime environment.
Type
`object`
Required
  • destinationPath
PropertyTypeDescription
destinationPathstringdestinationPath is the path within the buildah runtime environment at which the volume should be mounted. The transient mount within the build image and the backing volume will both be mounted read only. Must be an absolute path, must not contain '..' or ':', and must not collide with a destination path generated by the builder process Paths that collide with those added by the build controller will result in a failed build with an error message detailing which path caused the error.

.spec.strategy.dockerStrategy.volumes[].source​

Description
BuildVolumeSource represents the source of a volume to mount Only one of its supported types may be specified at any given time.
Type
`object`
Required
  • type
PropertyTypeDescription
configMapConfigMapVolumeSourceconfigMap represents a ConfigMap that should populate this volume
csiCSIVolumeSourcecsi represents ephemeral storage provided by external CSI drivers which support this capability
secretSecretVolumeSourcesecret represents a Secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret
typestringtype is the BuildVolumeSourceType for the volume source. Type must match the populated volume source. Valid types are: Secret, ConfigMap

.spec.strategy.jenkinsPipelineStrategy​

Description
JenkinsPipelineBuildStrategy holds parameters specific to a Jenkins Pipeline build. Deprecated: use OpenShift Pipelines
Type
`object`
PropertyTypeDescription
envarray (EnvVar)env contains additional environment variables you want to pass into a build pipeline.
jenkinsfilestringjenkinsfile defines the optional raw contents of a Jenkinsfile which defines a Jenkins pipeline build.
jenkinsfilePathstringjenkinsfilePath is the optional path of the Jenkinsfile that will be used to configure the pipeline relative to the root of the context (contextDir). If both JenkinsfilePath & Jenkinsfile are both not specified, this defaults to Jenkinsfile in the root of the specified contextDir.

.spec.strategy.sourceStrategy​

Description
SourceBuildStrategy defines input parameters specific to an Source build.
Type
`object`
Required
  • from
PropertyTypeDescription
envarray (EnvVar)env contains additional environment variables you want to pass into a builder container.
forcePullbooleanforcePull describes if the builder should pull the images from registry prior to building.
fromObjectReferencefrom is reference to an DockerImage, ImageStreamTag, or ImageStreamImage from which the container image should be pulled
incrementalbooleanincremental flag forces the Source build to do incremental builds if true.
pullSecretLocalObjectReferencepullSecret is the name of a Secret that would be used for setting up the authentication for pulling the container images from the private Docker registries
scriptsstringscripts is the location of Source scripts
volumesarrayvolumes is a list of input volumes that can be mounted into the builds runtime environment. Only a subset of Kubernetes Volume sources are supported by builds. More info: https://kubernetes.io/docs/concepts/storage/volumes
volumes[]objectBuildVolume describes a volume that is made available to build pods, such that it can be mounted into buildah’s runtime environment. Only a subset of Kubernetes Volume sources are supported.

.spec.strategy.sourceStrategy.volumes​

Description
volumes is a list of input volumes that can be mounted into the builds runtime environment. Only a subset of Kubernetes Volume sources are supported by builds. More info: https://kubernetes.io/docs/concepts/storage/volumes
Type
`array`

.spec.strategy.sourceStrategy.volumes[]​

Description
BuildVolume describes a volume that is made available to build pods, such that it can be mounted into buildah’s runtime environment. Only a subset of Kubernetes Volume sources are supported.
Type
`object`
Required
  • name
  • source
  • mounts
PropertyTypeDescription
mountsarraymounts represents the location of the volume in the image build container
mounts[]objectBuildVolumeMount describes the mounting of a Volume within buildah’s runtime environment.
namestringname is a unique identifier for this BuildVolume. It must conform to the Kubernetes DNS label standard and be unique within the pod. Names that collide with those added by the build controller will result in a failed build with an error message detailing which name caused the error. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
sourceobjectBuildVolumeSource represents the source of a volume to mount Only one of its supported types may be specified at any given time.

.spec.strategy.sourceStrategy.volumes[].mounts​

Description
mounts represents the location of the volume in the image build container
Type
`array`

.spec.strategy.sourceStrategy.volumes[].mounts[]​

Description
BuildVolumeMount describes the mounting of a Volume within buildah’s runtime environment.
Type
`object`
Required
  • destinationPath
PropertyTypeDescription
destinationPathstringdestinationPath is the path within the buildah runtime environment at which the volume should be mounted. The transient mount within the build image and the backing volume will both be mounted read only. Must be an absolute path, must not contain '..' or ':', and must not collide with a destination path generated by the builder process Paths that collide with those added by the build controller will result in a failed build with an error message detailing which path caused the error.

.spec.strategy.sourceStrategy.volumes[].source​

Description
BuildVolumeSource represents the source of a volume to mount Only one of its supported types may be specified at any given time.
Type
`object`
Required
  • type
PropertyTypeDescription
configMapConfigMapVolumeSourceconfigMap represents a ConfigMap that should populate this volume
csiCSIVolumeSourcecsi represents ephemeral storage provided by external CSI drivers which support this capability
secretSecretVolumeSourcesecret represents a Secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret
typestringtype is the BuildVolumeSourceType for the volume source. Type must match the populated volume source. Valid types are: Secret, ConfigMap

.spec.triggers​

Description
triggers determine how new Builds can be launched from a BuildConfig. If no triggers are defined, a new build can only occur as a result of an explicit client build creation.
Type
`array`

.spec.triggers[]​

Description
BuildTriggerPolicy describes a policy for a single trigger that results in a new Build.
Type
`object`
Required
  • type
PropertyTypeDescription
bitbucketobjectWebHookTrigger is a trigger that gets invoked using a webhook type of post
genericobjectWebHookTrigger is a trigger that gets invoked using a webhook type of post
githubobjectWebHookTrigger is a trigger that gets invoked using a webhook type of post
gitlabobjectWebHookTrigger is a trigger that gets invoked using a webhook type of post
imageChangeobjectImageChangeTrigger allows builds to be triggered when an ImageStream changes
typestringtype is the type of build trigger. Valid values:
- GitHub GitHubWebHookBuildTriggerType represents a trigger that launches builds on GitHub webhook invocations
- Generic GenericWebHookBuildTriggerType represents a trigger that launches builds on generic webhook invocations
- GitLab GitLabWebHookBuildTriggerType represents a trigger that launches builds on GitLab webhook invocations
- Bitbucket BitbucketWebHookBuildTriggerType represents a trigger that launches builds on Bitbucket webhook invocations
- ImageChange ImageChangeBuildTriggerType represents a trigger that launches builds on availability of a new version of an image
- ConfigChange ConfigChangeBuildTriggerType will trigger a build on an initial build config creation WARNING: In the future the behavior will change to trigger a build on any config change

.spec.triggers[].bitbucket​

Description
WebHookTrigger is a trigger that gets invoked using a webhook type of post
Type
`object`
PropertyTypeDescription
allowEnvbooleanallowEnv determines whether the webhook can set environment variables; can only be set to true for GenericWebHook.
secretstringsecret used to validate requests. Deprecated: use SecretReference instead.
secretReferenceobjectSecretLocalReference contains information that points to the local secret being used

.spec.triggers[].bitbucket.secretReference​

Description
SecretLocalReference contains information that points to the local secret being used
Type
`object`
Required
  • name
PropertyTypeDescription
namestringname is the name of the resource in the same namespace being referenced

.spec.triggers[].generic​

Description
WebHookTrigger is a trigger that gets invoked using a webhook type of post
Type
`object`
PropertyTypeDescription
allowEnvbooleanallowEnv determines whether the webhook can set environment variables; can only be set to true for GenericWebHook.
secretstringsecret used to validate requests. Deprecated: use SecretReference instead.
secretReferenceobjectSecretLocalReference contains information that points to the local secret being used

.spec.triggers[].generic.secretReference​

Description
SecretLocalReference contains information that points to the local secret being used
Type
`object`
Required
  • name
PropertyTypeDescription
namestringname is the name of the resource in the same namespace being referenced

.spec.triggers[].github​

Description
WebHookTrigger is a trigger that gets invoked using a webhook type of post
Type
`object`
PropertyTypeDescription
allowEnvbooleanallowEnv determines whether the webhook can set environment variables; can only be set to true for GenericWebHook.
secretstringsecret used to validate requests. Deprecated: use SecretReference instead.
secretReferenceobjectSecretLocalReference contains information that points to the local secret being used

.spec.triggers[].github.secretReference​

Description
SecretLocalReference contains information that points to the local secret being used
Type
`object`
Required
  • name
PropertyTypeDescription
namestringname is the name of the resource in the same namespace being referenced

.spec.triggers[].gitlab​

Description
WebHookTrigger is a trigger that gets invoked using a webhook type of post
Type
`object`
PropertyTypeDescription
allowEnvbooleanallowEnv determines whether the webhook can set environment variables; can only be set to true for GenericWebHook.
secretstringsecret used to validate requests. Deprecated: use SecretReference instead.
secretReferenceobjectSecretLocalReference contains information that points to the local secret being used

.spec.triggers[].gitlab.secretReference​

Description
SecretLocalReference contains information that points to the local secret being used
Type
`object`
Required
  • name
PropertyTypeDescription
namestringname is the name of the resource in the same namespace being referenced

.spec.triggers[].imageChange​

Description
ImageChangeTrigger allows builds to be triggered when an ImageStream changes
Type
`object`
PropertyTypeDescription
fromObjectReferencefrom is a reference to an ImageStreamTag that will trigger a build when updated It is optional. If no From is specified, the From image from the build strategy will be used. Only one ImageChangeTrigger with an empty From reference is allowed in a build configuration.
lastTriggeredImageIDstringlastTriggeredImageID is used internally by the ImageChangeController to save last used image ID for build This field is deprecated and will be removed in a future release. Deprecated
pausedbooleanpaused is true if this trigger is temporarily disabled. Optional.

.status​

Description
BuildConfigStatus contains current state of the build config object.
Type
`object`
PropertyTypeDescription
imageChangeTriggersarrayimageChangeTriggers captures the runtime state of any ImageChangeTrigger specified in the BuildConfigSpec, including the value reconciled by the OpenShift APIServer for the lastTriggeredImageID. There is a single entry in this array for each image change trigger in spec. Each trigger status references the ImageStreamTag that acts as the source of the trigger.
imageChangeTriggers[]objectImageChangeTriggerStatus tracks the latest resolved status of the associated ImageChangeTrigger policy specified in the BuildConfigSpec.Triggers struct.
lastVersionintegerlastVersion is used to inform about number of last triggered build.

.status.imageChangeTriggers​

Description
imageChangeTriggers captures the runtime state of any ImageChangeTrigger specified in the BuildConfigSpec, including the value reconciled by the OpenShift APIServer for the lastTriggeredImageID. There is a single entry in this array for each image change trigger in spec. Each trigger status references the ImageStreamTag that acts as the source of the trigger.
Type
`array`

.status.imageChangeTriggers[]​

Description
ImageChangeTriggerStatus tracks the latest resolved status of the associated ImageChangeTrigger policy specified in the BuildConfigSpec.Triggers struct.
Type
`object`
PropertyTypeDescription
fromobjectImageStreamTagReference references the ImageStreamTag in an image change trigger by namespace and name.
lastTriggerTimeTimelastTriggerTime is the last time this particular ImageStreamTag triggered a Build to start. This field is only updated when this trigger specifically started a Build.
lastTriggeredImageIDstringlastTriggeredImageID represents the sha/id of the ImageStreamTag when a Build for this BuildConfig was started. The lastTriggeredImageID is updated each time a Build for this BuildConfig is started, even if this ImageStreamTag is not the reason the Build is started.

.status.imageChangeTriggers[].from​

Description
ImageStreamTagReference references the ImageStreamTag in an image change trigger by namespace and name.
Type
`object`
PropertyTypeDescription
namestringname is the name of the ImageStreamTag for an ImageChangeTrigger
namespacestringnamespace is the namespace where the ImageStreamTag for an ImageChangeTrigger is located

API endpoints​

The following API endpoints are available:

  • /apis/build.openshift.io/v1/buildconfigs
    • GET: list or watch objects of kind BuildConfig
  • /apis/build.openshift.io/v1/watch/buildconfigs
    • GET: watch individual changes to a list of BuildConfig. deprecated: use the 'watch' parameter with a list operation instead.
  • /apis/build.openshift.io/v1/namespaces/{namespace}/buildconfigs
    • DELETE: delete collection of BuildConfig
    • GET: list or watch objects of kind BuildConfig
    • POST: create a BuildConfig
  • /apis/build.openshift.io/v1/watch/namespaces/{namespace}/buildconfigs
    • GET: watch individual changes to a list of BuildConfig. deprecated: use the 'watch' parameter with a list operation instead.
  • /apis/build.openshift.io/v1/namespaces/{namespace}/buildconfigs/{name}
    • DELETE: delete a BuildConfig
    • GET: read the specified BuildConfig
    • PATCH: partially update the specified BuildConfig
    • PUT: replace the specified BuildConfig
  • /apis/build.openshift.io/v1/watch/namespaces/{namespace}/buildconfigs/{name}
    • GET: watch changes to an object of kind BuildConfig. deprecated: use the 'watch' parameter with a list operation instead, filtered to a single item with the 'fieldSelector' parameter.

/apis/build.openshift.io/v1/buildconfigs​

HTTP method
`GET`
Description
list or watch objects of kind BuildConfig

HTTP responses

HTTP codeReponse body
200 - OKBuildConfigList schema
401 - UnauthorizedEmpty

/apis/build.openshift.io/v1/watch/buildconfigs​

HTTP method
`GET`
Description
watch individual changes to a list of BuildConfig. deprecated: use the &#x27;watch&#x27; parameter with a list operation instead.

HTTP responses

HTTP codeReponse body
200 - OKWatchEvent schema
401 - UnauthorizedEmpty

/apis/build.openshift.io/v1/namespaces/{namespace}/buildconfigs​

HTTP method
`DELETE`
Description
delete collection of BuildConfig

Query parameters

ParameterTypeDescription
dryRunstringWhen present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed

HTTP responses

HTTP codeReponse body
200 - OKStatus_v2 schema
401 - UnauthorizedEmpty
HTTP method
`GET`
Description
list or watch objects of kind BuildConfig

HTTP responses

HTTP codeReponse body
200 - OKBuildConfigList schema
401 - UnauthorizedEmpty
HTTP method
`POST`
Description
create a BuildConfig

Query parameters

ParameterTypeDescription
dryRunstringWhen present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed
fieldValidationstringfieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.

Body parameters

ParameterTypeDescription
bodyBuildConfig schema

HTTP responses

HTTP codeReponse body
200 - OKBuildConfig schema
201 - CreatedBuildConfig schema
202 - AcceptedBuildConfig schema
401 - UnauthorizedEmpty

/apis/build.openshift.io/v1/watch/namespaces/{namespace}/buildconfigs​

HTTP method
`GET`
Description
watch individual changes to a list of BuildConfig. deprecated: use the &#x27;watch&#x27; parameter with a list operation instead.

HTTP responses

HTTP codeReponse body
200 - OKWatchEvent schema
401 - UnauthorizedEmpty

/apis/build.openshift.io/v1/namespaces/{namespace}/buildconfigs/{name}​

Global path parameters

ParameterTypeDescription
namestringname of the BuildConfig
HTTP method
`DELETE`
Description
delete a BuildConfig

Query parameters

ParameterTypeDescription
dryRunstringWhen present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed

HTTP responses

HTTP codeReponse body
200 - OKStatus_v2 schema
202 - AcceptedStatus_v2 schema
401 - UnauthorizedEmpty
HTTP method
`GET`
Description
read the specified BuildConfig

HTTP responses

HTTP codeReponse body
200 - OKBuildConfig schema
401 - UnauthorizedEmpty
HTTP method
`PATCH`
Description
partially update the specified BuildConfig

Query parameters

ParameterTypeDescription
dryRunstringWhen present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed
fieldValidationstringfieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.

HTTP responses

HTTP codeReponse body
200 - OKBuildConfig schema
201 - CreatedBuildConfig schema
401 - UnauthorizedEmpty
HTTP method
`PUT`
Description
replace the specified BuildConfig

Query parameters

ParameterTypeDescription
dryRunstringWhen present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed
fieldValidationstringfieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.

Body parameters

ParameterTypeDescription
bodyBuildConfig schema

HTTP responses

HTTP codeReponse body
200 - OKBuildConfig schema
201 - CreatedBuildConfig schema
401 - UnauthorizedEmpty

/apis/build.openshift.io/v1/watch/namespaces/{namespace}/buildconfigs/{name}​

Global path parameters

ParameterTypeDescription
namestringname of the BuildConfig
HTTP method
`GET`
Description
watch changes to an object of kind BuildConfig. deprecated: use the &#x27;watch&#x27; parameter with a list operation instead, filtered to a single item with the &#x27;fieldSelector&#x27; parameter.

HTTP responses

HTTP codeReponse body
200 - OKWatchEvent schema
401 - UnauthorizedEmpty