Binary, the build will expect a
binary as input, and an inline Dockerfile is optional.
The binary is generally assumed to be a tar, gzipped tar, or zip file depending
on the strategy. For
Docker builds, this is the build context and an
optional Dockerfile may be specified to override any Dockerfile in the build
Source builds, this is assumed to be an archive as described
Docker builds, if
binary.asFile is set the
build context will consist of a single file named by the value of
contextDir field may be used when an archive is provided. Custom builds will
receive this binary as input on standard input (
A binary source potentially extracts content (if
asFile is not set), in which case
allows changing to a subdirectory within the content before the build executes.
The source definition is part of the
spec section in the
To include the secrets in a new build configuration, run the following command:
$ oc new-build openshift/nodejs-010-centos7~https://github.com/openshift/nodejs-ex.git --build-secret secret-npmrc
During the build, the .npmrc file is copied into the directory where the
source code is located. In case of the OpenShift Enterprise S2I builder images, this
is the image working directory, which is set using the
in the Dockerfile. If you want to specify another directory, add a
destinationDir to the secret definition:
You can also specify the destination directory when creating a new build
$ oc new-build openshift/nodejs-010-centos7~https://github.com/openshift/nodejs-ex.git --build-secret “secret-npmrc:/etc”
binary field specifies the details of the binary source.
asFile field specifies the name of the file that will be created with
the binary contents.
contextDir field specifies a subdirectory within the extracted contents of a
||If the optional
dockerfile field is provided, it should be a string
containing an inline Dockerfile that potentially replaces one within the
contents of the binary archive.