mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-07 00:48:01 +01:00
21 lines
870 B
Plaintext
21 lines
870 B
Plaintext
// Module included in the following assemblies:
|
|
// * builds/build-strategies.adoc
|
|
|
|
[id="builds-strategy-dockerfile-path_{context}"]
|
|
= Using Dockerfile path
|
|
|
|
By default, Docker builds use a Dockerfile (named Dockerfile) located at the root of the context specified in the `BuildConfig.spec.source.contextDir` field.
|
|
|
|
The `dockerfilePath` field allows the build to use a different path to locate your Dockerfile, relative to the `BuildConfig.spec.source.contextDir` field. It can be a different file name than the default Dockerfile (for example, `MyDockerfile`), or a path to a Dockerfile in a subdirectory (for example, `dockerfiles/app1/Dockerfile`).
|
|
|
|
.Procedure
|
|
|
|
To use the `dockerfilePath` field for the build to use a different path to locate your Dockerfile, set:
|
|
|
|
[source,yaml]
|
|
----
|
|
strategy:
|
|
dockerStrategy:
|
|
dockerfilePath: dockerfiles/app1/Dockerfile
|
|
----
|