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 centos7, openjdk-7 machine.

  • Docker Default Operating System
  • Couchbase PHP SDK in Docker Container
  • Persistent mysql data from docker container
  • Docker CPU contention with host processes
  • Docker kill an infinite process in a container after X amount of time
  • What is your convention for web app file locations? [closed]
  • I created a docker machine in a ridiculously short time 🙂 but my issue is more a maven one.

    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.

    — EDIT

    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.

  • configuring specific path under DocumentRoot to HTTPS of Apache server running on container
  • Why does my automated build run so slowly inside a Docker container?
  • Serve dockerized ZendFramework2 Application with nginx
  • error parsing HTTP 404 response body: invalid character '<' looking for beginning of value docker
  • Create a development environment for Laravel in Docker
  • php(unit) not displaying error output in docker container
  • 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 java:openjdk-7u65-jdk image.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.