3

I am using Spring Boot with Gradle plugin https://docs.spring.io/spring-boot/docs/current/gradle-plugin/reference/htmlsingle/#build-image to build OCI images. This works fine for basic use case (web application packaged as jar inside image). I more customization for my images

  • use curl to download some packages
  • install and customize those packages inside image

How to configure gradle plugin to do those steps? Before migrating to OCI buildpacks, I had Dockerfile with bash commands. With buildpacks, I see no way to customize build so image will include additional software.

Bartosz Bilicki
  • 12,599
  • 13
  • 71
  • 113
  • 2
    Does this answer your question? [Is it possible to customize docker image generated with Spring Native (with buildpack)](https://stackoverflow.com/questions/69447497/is-it-possible-to-customize-docker-image-generated-with-spring-native-with-buil) – Daniel Mikusa Oct 06 '21 at 14:16
  • This minimal invasive approach is maybe also a solution: https://stackoverflow.com/a/65393843/4964553 Simply install packages (e.g. curl) into the resulting image after the buildpack build like this: `docker run --user="root" --entrypoint launcher my-app:0.0.1-SNAPSHOT "apt-get update && apt-get install curl -y"`. See the other steps necessary [in the linked answer](https://stackoverflow.com/a/65393843/4964553). – jonashackt Oct 21 '21 at 09:27

0 Answers0