Skip to content

Commit

Permalink
Update bootBuildImage environment; don't replace it
Browse files Browse the repository at this point in the history
Assigning a new value to environment replaces all mappings. By assigning to individual keys, the existing map is updated so defaults are preserved.

See: spring-projects/spring-boot#32886
  • Loading branch information
candrews committed Nov 30, 2022
1 parent df3c67d commit 1ebe4a2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ tasks.withType(AbstractArchiveTask) {
// See: https://candrews.integralblue.com/2022/10/improving-the-reproducibility-of-spring-boots-docker-image-builder/
tasks.named("bootBuildImage") {
// See: https://paketo.io/docs/howto/java/
environment = [
// run the JLink tool and install a minimal JRE for runtime, reducing both image size and attack surface
"BP_JVM_JLINK_ENABLED" : "true",
]

// run the JLink tool and install a minimal JRE for runtime, reducing both image size and attack surface
environment["BPJVM_JLINK_ENABLED"] = "true"

docker {
// version and digest pin all image references. This ensures reproducibility.
// make sure to configure Renovate to keep these image references up to date.
Expand Down

0 comments on commit 1ebe4a2

Please sign in to comment.