melatonina
04/19/2021, 9:44 AMjar {
// ... Manifest stuff
from {
configurations.compile.collect {
it.isDirectory() ? it : zipTree(it)
}
}
}
This works with my test project but has no effect in my actual project. What could be the cause?Vampire
04/19/2021, 9:48 AMapplication
plugin that you then can but into the docker image for running it.
Imho 98.7 % of fat jars are evil, a too wide-spread bad practicy, and an abuse of Java functionality with absolutely no added value which in some cases even cannot work and can also all too easily be done wrongly and break things that would otherwise work fine.Vampire
04/19/2021, 9:52 AMdistTar
task is run before the docker image is built and then use ADD <your-app>.tar /opt/
in the Dockerfile to copy and unpack the built distribution tar into your docker image and then you can use the generated start script in the bin
directory as entrypoint.melatonina
04/19/2021, 9:58 AMdistTar
is run when I execute the application with IntelliJ IDEA?Vampire
04/19/2021, 10:14 AMdistTar
is for building a distributable archive, not for running from the IDE.Vampire
04/19/2021, 10:15 AMrun
task from IJ, which will assemble distribution exactly like in the archive, just exploded in build/install/
and runs it.Vampire
04/19/2021, 10:15 AMmelatonina
04/19/2021, 10:18 AMmelatonina
04/19/2021, 10:44 AMmelatonina
04/19/2021, 10:49 AMVampire
04/19/2021, 11:09 AMJAVA_OPTS
and one specific to your application <YOUR_APPLICATION>_OPTS
that you can set to enable debugging for example.
If you don't need it 100% like in production but it is sufficient if the code is run in the target docker container, the new run targets feature of IntelliJ 2021.1 might be what you need.
With that you can run and debug nicely within Docker containers, on remote SSH hosts, ...melatonina
04/19/2021, 1:05 PMFailed to deploy 'decker2 Dockerfile: x/y/z/Dockerfile': org.apache.commons.cli.ParseException: Unrecognized argument: null
Figure 1 is how I setup the remote debugging configuration.
Figure 2 is how I (didn't) setup the "Launch Docker before debug" task.
What's missing? Am I supposed to copy the JVM arguments somewhere?Vampire
04/19/2021, 1:07 PMVampire
04/19/2021, 1:09 PMmelatonina
04/19/2021, 1:49 PMVampire
04/19/2021, 1:59 PMnull
as argument which is not recognized as a valid parameter.
Regarding the remote debugging approach, as I said, it depends on how you start your application.
If you for example use the result of the application
plugin, you can set the environment variable <YOUR_APPLICATION>_OPTS
(look inside the generated start script for the exact one) or the environment variable JAVA_OPTS
.
Actually independent of how you start your application, you can also always set the environment variable JAVA_TOOL_OPTIONS
which is picked up by the JVM automatically not matter how you start your application.
I'm sure you can configure environment variables in the docker run configuration.melatonina
04/19/2021, 2:06 PMVampire
04/19/2021, 2:10 PMVampire
04/19/2021, 2:12 PMmelatonina
04/19/2021, 2:33 PMVampire
04/19/2021, 2:35 PMFleshgrinder
04/20/2021, 6:19 AMorg.gradle.parallel
.melatonina
04/20/2021, 10:31 AM