Maven cache container
Create the cache container
Create the container using the following
docker create --name maven omnisol/maven
This will create a container named maven which will only serve as a storage for artifacts.
Optionally, you can map a settings.xml file when creating the container:
docker create --name maven \ -v <full path to settings.xml>:/home/maven/.m2/settings.xml \ omnisol/maven
When inside a project folder, run the following to use the artifact cache:
docker run --rm \ --volumes-from maven \ -v `pwd`:/var/`basename $PWD` \ -w /var/`basename $PWD` \ omnisol/maven mvn <command>
This is equivalent to running mvn \<command\>, only that it runs in a temporary container,
using the artifact cache from the maven container.