Docker maven plugin ClientProtocolException (Windows 10 using Docker Toolbox)

I am trying to build a docker image using the docker-maven-plugin (provided by spotify: but things aren't really working out. At first I got this exception:

org.apache.http.conn.HttpHostConnectException: Connect to localhost:2375

I found out that I had to create an env. variable to fix this (


So after setting that env. variable I keep getting this ClientProtocolException:

[ERROR] Failed to execute goal com.spotify:docker-maven-plugin:0.3.258:build (default-cli) on project docker_micro_maven: Exception caught: java.util.concurrent.ExecutionException: org.apache.http.client.ClientProtocolException: The server failed to respond with a valid HTTP response

I have no idea how I could fix this, any input would be greatly appreciated.


You have to configure virtualbox port forwarding with host listen on 2375 port :

> VBoxManage modifyvm "default" --natpf1 "guestssh,tcp,,2375,,2376"

guestssh is the name of port forwarding, you can choose the name.

if VBoxManage isn't recognise, you can replace it by full path :


And after if you have an issue like "The server failed to respond with a valid HTTP response" copy the certs files from "%USER%.docker\machines\certs" to "%USER%.docker" cause docker-maven-plugin read this files in "%USER%.docker" (don't copy directory certs, just files).

I think we can override maven properties to replace port 2375 and certs path, but i don't still find it.

fixed this by:


Important are these two tags:


I am using a dockerfile, which path you have to define with this tag:


Now you can build your jar and generate docker image via:

mvn package docker:build

docker-machine env default

set DOCKER_HOST=tcp://
set DOCKER_TOOLBOX_INSTALL_PATH=C:\Program Files\Docker Toolbox
set DOCKER_CERT_PATH=C:\Users\panhl-a\.docker\machine\machines\default

Need Your Help

Tutorial in using generatedInitialize()

graphics prolog 2d logic-programming

Recently I had been told that prolog can create a graphical display, and told that by using the predicate generatedInitialize().

If data set has rows?


I have one more question