openshift-cli-ex-dockerbuild man page

openshift cli ex dockerbuild — Perform a direct Docker build


openshift cli ex dockerbuild [Options]


Build a Dockerfile into a single layer

Builds the provided directory with a Dockerfile into a single layered image. Requires that you have a working connection to a Docker engine. You may mount secrets or config into the build with the --mount flag - these files will not be included in the final image.

Experimental: This command is under active development and may change without notice.


Pull the images that are not present.
An optional path to a Dockerfile to use.
An optional list of files and directories to mount during the build. Use SRC:DST syntax for each path.

Options Inherited from Parent Commands

DEPRECATED: The API version to use when talking to the server

Username to impersonate for the operation.

Path to a cert. file for the certificate authority.

Path to a client certificate file for TLS.

Path to a client key file for TLS.

The name of the kubeconfig cluster to use

Path to the config file to use for CLI requests.

The name of the kubeconfig context to use

The Google Cloud Platform Service Account JSON Key to use for authentication.

If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.

Maximum number of seconds between log flushes

Require server version to match client version

-n, --namespace=""
If present, the namespace scope for this CLI request.

The address and port of the Kubernetes API server

Bearer token for authentication to the API server.

The name of the kubeconfig user to use


# Build the current directory into a single layer and tag
openshift cli ex dockerbuild . myimage:latest

# Mount a client secret into the build at a certain path
openshift cli ex dockerbuild . myimage:latest --mount  /mysecret.pem:/etc/pki/secret/mysecret.pem

See Also



June 2016, Ported from the Kubernetes man-doc generator

Referenced By


Explore man page connections for openshift-cli-ex-dockerbuild(1).

Openshift Openshift CLI User Manuals June 2016