I have a docker image that contains a regular maven installation, jdk and other build tools.
I use it to run mvn (volume-mounting only my project sources and .m2) both during local development and on the build-server.
I like this because it makes sure my local builds are built exactly like on the build-server (which uses the same "build image"). The Dockerfile of my build image is also important as it completely defines the build environment and tools.
I'm wondering how to get the benefits of mvnd while sticking to that "build image" concept (building in a docker container).
A couple of questions pop up:
- i'ld need to keep the build container alive across builds to enjoy the mvnd speedup
- so to compile n different projects i'ld have to keep n build-containers running
- unless if i'ld mount my whole data dir with all projects - which is something i'ld rather avoid, as by only mounting project x sources, i'm sure the build of project x is not relying on resources outside of project x
So, with mvnd on the host all is awesome - assuming you build (call mvnd) on the host too (and not in some docker container).
I'm wondering if there's a way to have 1 single long-running mvnd container (running all the time), and then when i launch my own build docker container (mounting project x sources), it somehow connects to the long-running mvnd, such that my build container talks to that long-running mvnd to get the mvn job done faster.
I have a docker image that contains a regular maven installation, jdk and other build tools.
I use it to run mvn (volume-mounting only my project sources and .m2) both during local development and on the build-server.
I like this because it makes sure my local builds are built exactly like on the build-server (which uses the same "build image"). The Dockerfile of my build image is also important as it completely defines the build environment and tools.
I'm wondering how to get the benefits of mvnd while sticking to that "build image" concept (building in a docker container).
A couple of questions pop up:
So, with mvnd on the host all is awesome - assuming you build (call mvnd) on the host too (and not in some docker container).
I'm wondering if there's a way to have 1 single long-running mvnd container (running all the time), and then when i launch my own build docker container (mounting project x sources), it somehow connects to the long-running mvnd, such that my build container talks to that long-running mvnd to get the mvn job done faster.