You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow image application directory to be configurable
An `applicationDirectory` option on the Maven
`spring-boot:build-image` goal and the Gradle `bootBuildImage` task
can be configured to set the location that will be used to upload
application contents to the builder image, and will contain the
application contents in the generated image.
Closesgh-34786
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/BuildRequest.java
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/build/Lifecycle.java
+10-3Lines changed: 10 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -76,6 +76,8 @@ class Lifecycle implements Closeable {
76
76
77
77
privatefinalVolumeNamelaunchCacheVolume;
78
78
79
+
privatefinalStringapplicationDirectory;
80
+
79
81
privatebooleanexecuted;
80
82
81
83
privatebooleanapplicationVolumePopulated;
@@ -101,6 +103,7 @@ class Lifecycle implements Closeable {
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/BuildRequestTests.java
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/build/LifecycleTests.java
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/packaging-oci-image.adoc
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -199,6 +199,12 @@ The values provided to the `tags` option should be full image references in the
199
199
The value must be a string in the ISO 8601 instant format, or `now` to use the current date and time.
200
200
| A fixed date that enables https://buildpacks.io/docs/features/reproducibility/[build reproducibility].
201
201
202
+
| `applicationDirectory`
203
+
| `--applicationDirectory`
204
+
| The path to a directory that application contents will be uploaded to in the builder image.
205
+
Application contents will also be in this location in the generated image.
206
+
| `/workspace`
207
+
202
208
|===
203
209
204
210
NOTE: The plugin detects the target Java compatibility of the project using the JavaPlugin's `targetCompatibility` property.
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootBuildImage.java
+19Lines changed: 19 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -270,6 +270,16 @@ public void launchCache(Action<CacheSpec> action) {
270
270
@Option(option = "createdDate", description = "The date to use as the created date of the image")
271
271
publicabstractProperty<String> getCreatedDate();
272
272
273
+
/**
274
+
* Returns the directory that contains application content in the image. When
275
+
* {@code null}, a default location will be used.
276
+
* @return the application directory
277
+
*/
278
+
@Input
279
+
@Optional
280
+
@Option(option = "applicationDirectory", description = "The directory containing application content in the image")
0 commit comments