Maven build, test and run on a docker machine
It’s probably too soon to ask this question but I hope someone has already had the same problem as me.
I have to build a
jar that run on a
My questions is :
How to generate a jar on remote machine (container powered by kitematic on mac for example :p) with the jdk and environment of this machine ?
Any help we’ll be welcome.
I develop on my mac and I would like to launch the build on a “remote” machine which is, in local, my docker container on the kitematic vm.
One Solution collect form web for “Maven build, test and run on a docker machine”
I think you’re just asking how to compile source on your local Mac using a container. If you have boot2docker installed, the following works:
$ docker run -v $(pwd)/java_proj:/java_proj java:openjdk-7u65-jdk javac /java_proj/Test.java
Assuming you have a folder
java_proj in your current directory with the file
Test.java, this will compile the test file and should place the output in the same folder. We can do this as the boot2docker VM shares your home directory and we can then mount the folder as a volume inside the container. The code will be compiled using the compiler and environment of the