Docker: In Dockerfile, copy files temporarily, but not for final image -
I have a Java service that I would like to package, and the only thing that is the jar file of the last dock image is Config file However, first of all, I need to run my Here is my current Dockerfile: You can see that I have to do the I'm probably missing something, but how do I An image creation is as follows: ... Docker The build command will use the docfiler as the directory that is in the form of a build contact (including all its subdirectories). The build context will be sent to the Doker Damon before creating the image, which means that if you use the source repository, the entire contents of your hard drive will be sent to the daemon ... < P> See There is no way to achieve what I want you to do. There are two options: To maintain all the build dependency inside the image and blot your image to create your JR file inside the container. I advise to make my jar separately and when they are created, simply executable and config file gradle command to create JAR, but I should not do that the
gradle result uses the Docker image.
Get the update exactly & amp; Apt-get install -y openjdk-7-jdk Copy / run ./gradlew shadowJar CMD ["java", "-zer", "service / build / lbs / service.jar", "server", "service / service .imil "]
copy first so that I can
. / Gradlew (otherwise it says that the command can not be found). But in the end, I only need all the
service.jar and
service.yml files.
. / Gradlew can provide everything during the build phase, but only the result image includes
service.jar and
service.yml .
ADD means that all Build dependencies should be available on your development environment, but your image is as small as it can be.
Comments
Post a Comment