Accessing docker host from (jenkins) docker container

前端 未结 3 563
名媛妹妹
名媛妹妹 2021-01-15 05:51

I need to run docker commands from jenkins which is installed as a container on docker. My local setup is on an OSX and I use boot2docker to virtualize the docker machine.

3条回答
  •  礼貌的吻别
    2021-01-15 06:21

    As @ISanych suggests you can simply do -v /var/run/docker.sock:/var/run/docker.sock and it will also magically work on boot2docker. No need to define DOCKER_URL.

    You might also find --net=host useful if need to access the ports of the started containers.

提交回复
热议问题