What is happening when docker-maven plugin tries to build image?

前端 未结 8 1908
[愿得一人]
[愿得一人] 2021-02-12 20:40

I am running Jenkins in a docker container and Jenkins tries to run my maven build. As part of the build, the docker maven plugin instructs it to build a docker image.

8条回答
  •  生来不讨喜
    2021-02-12 21:12

    I was able to solve the problem by combining elements of both upvoted answers.

    Set options to use different port in /etc/default/docker.

    DOCKER_OPTS="-H tcp://127.0.0.1:4243"
    

    Restart the Docker daemon.

    sudo service docker restart
    

    Then build your package.

    export DOCKER_HOST=tcp://127.0.0.1:4243
    mvn clean package docker:build
    

提交回复
热议问题