gradle-docker
gradle-docker copied to clipboard
Add 'target' parameter support for multi stage builds
Hello,
Docker has a wonderful feature to create multi-stage builds however the plugin does not support this. Can you please add 'target' parameter into build task so that feature can be used?
Thank you
Hi,
I'm relatively new to the whole containerizing solution and all. But I came across the multi-stage build and wondered the same thing. I was following the guide to create a docker container.
The only change I've made from the guide was that to utilize base image of openjdk:8-jre-alpine . I believe you do not need to do the multi-stage build because you already are utilizing only jre to run your container and not the entire jdk. Also the gradlew docker build command builds a bootJar before hand and inserts that in to the container.
With just a simple spring boot rest controller that returns hello world my image size is only 98.1MB. I think this is pretty darn small.
Someone should step in and correct me if I've got any of the above wrong.
Thanks