Add support for build workspace option when building images
Closes gh-37478
This commit is contained in:
@@ -202,12 +202,19 @@ The value supplied will be passed unvalidated to Docker when creating the builde
|
||||
The values provided to the `tags` option should be full image references in the form of `[image name]:[tag]` or `[repository]/[image name]:[tag]`.
|
||||
|
|
||||
|
||||
| `buildWorkspace`
|
||||
| A temporary workspace that will be used by the builder and buildpacks to store files during image building.
|
||||
The value can be a named volume or a bind mount location.
|
||||
| A named volume in the Docker daemon, with a name derived from the image name.
|
||||
|
||||
| `buildCache`
|
||||
| A cache containing layers created by buildpacks and used by the image building process.
|
||||
The value can be a named volume or a bind mount location.
|
||||
| A named volume in the Docker daemon, with a name derived from the image name.
|
||||
|
||||
| `launchCache`
|
||||
| A cache containing layers created by buildpacks and used by the image launching process.
|
||||
The value can be a named volume or a bind mount location.
|
||||
| A named volume in the Docker daemon, with a name derived from the image name.
|
||||
|
||||
| `createdDate` +
|
||||
@@ -403,7 +410,7 @@ include::../maven/packaging-oci-image/docker-pom-authentication-command-line.xml
|
||||
----
|
||||
|
||||
[[build-image.examples.caches]]
|
||||
=== Builder Cache Configuration
|
||||
=== Builder Cache and Workspace Configuration
|
||||
|
||||
The CNB builder caches layers that are used when building and launching an image.
|
||||
By default, these caches are stored as named volumes in the Docker daemon with names that are derived from the full name of the target image.
|
||||
@@ -416,7 +423,10 @@ The cache volumes can be configured to use alternative names to give more contro
|
||||
include::../maven/packaging-oci-image/caches-pom.xml[tags=caches]
|
||||
----
|
||||
|
||||
The caches can be configured to use bind mounts instead of named volumes, as shown in the following example:
|
||||
Builders and buildpacks need a location to store temporary files during image building.
|
||||
By default, this temporary build workspace is stored in a named volume.
|
||||
|
||||
The caches and the build workspace can be configured to use bind mounts instead of named volumes, as shown in the following example:
|
||||
|
||||
[source,xml,indent=0,subs="verbatim,attributes",tabsize=4]
|
||||
----
|
||||
|
||||
@@ -8,6 +8,11 @@
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<image>
|
||||
<buildWorkspace>
|
||||
<bind>
|
||||
<source>/tmp/cache-${project.artifactId}.work</source>
|
||||
</bind>
|
||||
</buildWorkspace>
|
||||
<buildCache>
|
||||
<bind>
|
||||
<source>/tmp/cache-${project.artifactId}.build</source>
|
||||
|
||||
Reference in New Issue
Block a user