maven package docker:build - connection refused

后端 未结 10 2263
梦谈多话
梦谈多话 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条回答
  •  旧时难觅i
    2021-02-07 05:34

    On windows 7 64 the docker env seems a bit tricky to install as it requires a linuxVM to run (update issues with previous vbox installation) https://github.com/docker/machine/issues/3396 )

    Luckily in the docker quickstart terminal we can do:

       $ docker-machine.exe env
       export DOCKER_TLS_VERIFY="1"
       export DOCKER_HOST="tcp://192.168.99.101:2376"
       export DOCKER_CERT_PATH="C:\Users\uv\.docker\machine\machines\default"
       export DOCKER_MACHINE_NAME="default"
       # Run this command to configure your shell:
       # eval $("C:\Program Files\Docker Toolbox\docker-machine.exe" env)
    

    showing us what to put into the plugin configuration

       https://192.168.99.101:2376
    

    but only after using the advice found here:

    Docker: An error occurred trying to connect

    with the important part being:

    Run FOR /f "tokens=*" %i IN ('docker-machine env --shell cmd default') DO %i
    

    we can run the mvnw docker:build successfully in the cmd/intellij terminal :)

提交回复
热议问题