dmitrievanthony dmitrievanthony - 6 months ago 46
reST (reStructuredText) Question

Docker maven plugin

Docker plugin which I found (spotify/docker-maven-plugin) use native

application, but as far as I understand
is just an REST API client which "redirects" commands to docker daemon process.
It's especially true in case if I use docker on Windows machine and docker daemon works on Linux in Virtual Box.

So, does any docker-maven-plugin exist which doesn't require native
application and just "talking" with docker daemon without any intermediaries?


It doesn't require a native docker application, so much as knowing where the docker daemon is.


Per the documentation:

By default the plugin will try to connect to docker on localhost:2375. Set the DOCKER_HOST environment variable to connect elsewhere.


This is how the client knows where Docker daemon is. Docker-Maven-Plugin respects this (and other) Docker environment variables to know where Docker resides, whether it be native, in a VM running on a hypervisor like VirtualBox locally, or on a completely remote server.

Docker Machine

If you're using Docker Machine, these environment variables are set when you run :

$ docker-machine env default
export DOCKER_HOST="tcp://"
export DOCKER_CERT_PATH="/Users/<yourusername>/.docker/machine/machines/default"
export DOCKER_MACHINE_NAME="default"
# Run this command to configure your shell:
# eval "$(docker-machine env default)"

$ eval "$(docker-machine env default)"

The documentation for Docker Machine:

Create & Connect to Docker Machine

Docker for Windows

If you're on Windows, you may find it helpful to use the native client Docker produces to give everything a more native experience.

Docker for Windows