1

I am using the jolokia Docker Maven Plugin for building a Java Application on Ubuntu 14 on a VM. Everytime I try maven clean package I get

[ERROR] Failed to execute goal org.jolokia:docker-maven-plugin:0.11.0:build (build) on project places_app: Execution build of goal org.jolokia:docker-maven-plugin:0.11.0:build failed: No url given and no DOCKER_HOST environment variable set -> [Help 1]

The DOCKER_HOST is set to:DOCKER_HOST=tcp://127.0.0.1:4243

When trying telnet localhost 4243 the connection doesn't work.

Can someone help me with this problem?

Shachty
  • 521
  • 2
  • 7
  • 16
  • Do you have a Docker daemon running locally (or within some VM like for Boot2Docker or Vagrant ?). Also, if you start the daemon you should take care that is opening a TCP port for an IP based access (in addition to the Unix socket based one). I.e. it should have been started with a -H option. The error message itself indicates something different, though. Do you really exported the DOCKER_HOST variable on the server where Maven is running ? What do you see when you echo $DOCKER_HOST ? – Roland Huß Apr 02 '15 at 18:32

2 Answers2

2

ubuntu

Open /etc/default/docker file and add below line at the end of file

DOCKER_OPTS="-H tcp://127.0.0.1:4243 -H unix:///var/run/docker.sock"

Then restart the docker deamon

sudo service docker restart
export DOCKER_HOST=tcp://localhost:4243
sudo netstat -plant | grep 4243

boot2docker

Open /var/lib/boot2docker/profile file and add below line at the end of file

DOCKER_TLS=no
DOCKER_HOST="-H tcp://0.0.0.0:4243"

Then restart the docker deamon

sudo /etc/init.d/docker restart
sudo netstat -plant | 4243

Add the below in your environmental variable in windows / mac

DOCKER_HOST=tcp://192.168.59.103:4243    

Now do

mvn docker:build -Ddocker.skip=false

it should work

Note: Create the file If its not there in the particular location.

Community
  • 1
  • 1
arulraj.net
  • 4,579
  • 3
  • 36
  • 37
0

For those of you using the "put a file in /etc/systemd/system/docker.service.d" config style instead of "edit /etc/default/docker" config style, setting this as the contents of my /etc/systemd/system/docker.service.d/socket.conf file:

[Service]
ExecStart=
ExecStart=/usr/bin/docker daemon -H tcp://127.0.0.1:4243 -H unix:///var/run/docker.sock 

and running these commands:

sudo systemctl daemon-reload
sudo systemctl restart docker

and of course setting the DOCKER_HOST as described above, did the trick.

edburns
  • 482
  • 1
  • 4
  • 13