maven package docker:build - connection refused

后端 未结 10 2086
梦谈多话
梦谈多话 2021-02-07 05:06

I am trying to directly build a docker image with maven with mvn package docker:build.

Docker is running and docker ps shows me my containers,

相关标签:
10条回答
  • 2021-02-07 05:38

    If docker is running of Docker for Windows, then below things need to be completed: 1. Open Docker Settings 2. Enable the checkbox - Expose daemon on tcp://localhost:2375 without TLS

    Normally, docker opens up port 2376 for docker client but for legacy or other application connect using 2375 port using TCP. If you are using com.spotify it depends upon version also. The latest com.spotify plugin with latest docker working correctly else need to define a variable that tells the plugin to get the hostname from specified environment variable.

    To set the hostname manually for the docker set the variable into the environment variable list: DOCKER_HOST="tcp://127.0.00:2376"

    It will work for localhost, if docker is running on another machine then set the ip of the same machine.

    0 讨论(0)
  • 2021-02-07 05:41

    I fixed this by updating docker-maven-plugin version to 1.4.13.

    0 讨论(0)
  • 2021-02-07 05:43

    In ubuntu 16.04, I solved it with:

    DOCKER_HOST=unix:///var/run/docker.sock mvn clean install 
    
    0 讨论(0)
  • 2021-02-07 05:50

    Try to run 'docker-machine ls' to check for the IP, if it's not a localhost address, you will need a dockerHost tag in your plugin configuration. ex: <dockerHost>https://192.168.99.100:2376</dockerHost>

    newest version of the plugin is 0.4.1 not 0.2.3

    0 讨论(0)
提交回复
热议问题