简体   繁体   中英

Configuring Docker host in jenkins

I have installed Jenkins ver. 2.73.3 in Ubuntu 17.10 Same machine also has Docker version 17.09.0-ce.

I also added the following line in /etc/default/docker file 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

After this in the Jenkins Configure page for Docker cloud. I get the following error. Please see the attached screenshot 在此处输入图片说明

in your case docker daemon is not considering the /etc/default/docker file, you can check my making some syntax error in above file. else run this cmd and do a test once. dockerd -H unix:///var/run/docker.sock -H tcp://0.0.0.0:2375 &

before firing command stop all the docker service and kill containers if any

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM