A way to add files in the resulting image #196
Replies: 3 comments 5 replies
-
Another comment: I'm trying to solve the issue with spring boot plugin by adding the source-removal build pack to the build. But I'm getting this error: Pulling buildpack image 'docker.io/paketo-buildpacks/source-removal:latest' ..................................................
I cannot pull the source-removal image from any docker registry... tryed using: docker pull /paketo-buildpacks/source-removal How to add the source-removal buildpack? I don't think adding the gradle buildpack is the correct answer because spring boot plugin is able to generate the image without using it to build the app. |
Beta Was this translation helpful? Give feedback.
-
Second note: adding the gradle buildpack but is not picked by the plugin command. I think it is explicity disabled by the plugin |
Beta Was this translation helpful? Give feedback.
-
Things are different from the command line and from Spring Boot's plugin. The Spring Boot plugin will compile your application locally and then build the image from your executable JAR. By default, When you try to tell it to retain files and you use the Spring Boot plugin, it doesn't work because those files are already gone (or at the least, in a different folder structure because they are in your JAR). What I would suggest is to put everything you require into your JAR file. This will ensure that it ends up in the resulting container image without any additional configuration. Everything in the JAR ends up in the image, regardless of how you build. If you cannot do that, then a couple of notes:
Hope that helps! |
Beta Was this translation helpful? Give feedback.
-
I'm using spring boot plugin to build images, which in turn use some build pack. This is the list of buildpacks used:
paketo-buildpacks/ca-certificates 3.6.1
[creator] paketo-buildpacks/bellsoft-liberica 10.2.0
[creator] paketo-buildpacks/syft 1.28.0
[creator] paketo-buildpacks/executable-jar 6.6.3
[creator] paketo-buildpacks/dist-zip 5.5.2
[creator] paketo-buildpacks/spring-boot 5.23.0
[creator] paketo-buildpacks/environment-variables 4.5.1
When using the command line to build instead of the plugin it uses the following build pack:
paketo-buildpacks/ca-certificates 3.6.1
[detector] paketo-buildpacks/bellsoft-liberica 10.2.0
[detector] paketo-buildpacks/syft 1.28.0
[detector] paketo-buildpacks/gradle 7.1.0
[detector] paketo-buildpacks/executable-jar 6.6.3
[detector] paketo-buildpacks/apache-tomcat 7.13.0
[detector] paketo-buildpacks/apache-tomee 1.6.1
[detector] paketo-buildpacks/liberty 3.6.0
[detector] paketo-buildpacks/dist-zip 5.5.2
[detector] paketo-buildpacks/spring-boot 5.23.0
[detector] paketo-buildpacks/environment-variables 4.5.1
When I use the env variable BP_INCLUDE_FILES=newrelic/* as mentioned in the documentation. The file is not added using the plugin, but is added using the command line. Investigation shows that the buildpack which is participating and copying the artifacts is packeto-buildpackes/gradle
Other buildpack which claims to add files using this env variable is paketo-buildpacks/source-removal. But as a user I find this quite confusing and I spend 2 days figuring out why the file is not being added.
Should this behavior be independent of buildpacks added? I think this should be a core feature.
Beta Was this translation helpful? Give feedback.
All reactions