For example to add javaagent

Comment From: wilkinsona

Thanks for the suggestion. There are two main pieces involved here, Spring Boot's Maven or Gradle plugin and the Builder that's used to create the image. It's the Builder, via the buildpacks that it uses, that determines the contents of the image rather than Spring Boot itself. It may be that the Java buildpack can already do what you want (IIRC, it has some support for New Relic's agent, for example) or you may need to create your own builder with a buildpack that makes the necessary contributions to the image. There's some information about authoring your own buildpack on buildpacks.io.

/cc @nebhale in case he has anything to add

Comment From: ghilainm

Is there any simple way to do that without any experience with buildpacks?

Comment From: scottfrederick

@ghilainm As Andy said, buildpacks are the only way that the contents of the image can be customized. The Paketo project has examples of buildpacks that add java agents to the image, listed here. If you want to add some other type of files to an image, you might want to engage with the buidpacks community and ask questions there.