在jenkins中configurationDocker主机

我已经安装了Jenkins版本。 Ubuntu 17.10中的2.73.3同样的机器也有Docker版本17.09.0-ce。

我还在/ etc / default / docker文件中添加了以下行:DOCKER_OPTS =“docker -H tcp://127.0.0.1:2375 -H unix:///var/run/docker.sock”

cat /etc/default/docker # Docker Upstart and SysVinit configuration file # # THIS FILE DOES NOT APPLY TO SYSTEMD # # Please see the documentation for "systemd drop-ins": # https://docs.docker.com/engine/admin/systemd/ # # Customize location of Docker binary (especially for development testing). #DOCKERD="/usr/local/bin/dockerd" # Use DOCKER_OPTS to modify the daemon startup options. #DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4" DOCKER_OPTS="docker -H tcp://127.0.0.1:2375 -H unix:///var/run/docker.sock" # If you need Docker to use an HTTP proxy, it can also be specified here. #export http_proxy="http://127.0.0.1:3128/" # This is also a handy place to tweak where Docker's temporary files go. #export DOCKER_TMPDIR="/mnt/bigdrive/docker-tmp" ---------------------------------- sudo systemctl daemon-reload sudo service docker restart 

之后在Docker云的Jenkinsconfiguration页面中。 我得到以下错误。 请参阅附件截图 在这里输入图像说明

在你的情况下,docker守护进程不考虑/ etc / default / docker文件,你可以检查我在上面的文件中犯了一些语法错误。 否则运行这个cmd并做一次testing。 dockerd -H unix:///var/run/docker.sock -H tcp://0.0.0.0:2375&

在发射之前命令停止所有的docker服务并杀死容器(如果有的话)