mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 12:46:18 +01:00
22 lines
869 B
Plaintext
22 lines
869 B
Plaintext
// Module included in the following assemblies:
|
|
// * builds/build-strategies.adoc
|
|
|
|
:_mod-docs-content-type: PROCEDURE
|
|
[id="builds-strategy-dockerfile-path_{context}"]
|
|
= Using Dockerfile path
|
|
|
|
By default, docker builds use a 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, such as `MyDockerfile`, or a path to a Dockerfile in a subdirectory, such as `dockerfiles/app1/Dockerfile`.
|
|
|
|
.Procedure
|
|
|
|
* Set the `dockerfilePath` field for the build to use a different path to locate your Dockerfile:
|
|
+
|
|
[source,yaml]
|
|
----
|
|
strategy:
|
|
dockerStrategy:
|
|
dockerfilePath: dockerfiles/app1/Dockerfile
|
|
----
|