Search code examples
mavenubuntudockerjolokia

Getting LifeCiycleException using Docker Maven Plugin on Ubuntu 14


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?


Solution

  • 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.