Accessing docker host from (jenkins) docker container

前端 未结 3 678
名媛妹妹
名媛妹妹 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:25

    I ran into exact same problem with my Jenkins docker plugin. Docker uses tls by default but docker plugin only supports http. What I did is disabling TLS verification on the docker machine. My docker machine is an Ubuntu so the docker conf file is under /etc/default/docker. Inside the conf file, you can disable TLS by adding

    --tls=false 
    

    in DOCKER_OPTS. Something like:

    DOCKER_OPTS='-H tcp://0.0.0.0:2376 -H unix:///var/run/docker.sock --tls=false'
    

提交回复
热议问题