/ / Configurando o host do Docker em jenkins - ubuntu, docker, jenkins

Configurando o Docker host no jenkins - ubuntu, docker, jenkins

Eu instalei Jenkins ver. 2.73.3 no Ubuntu 17.10 A mesma máquina também possui o Docker versão 17.09.0-ce.

Eu também adicionei a seguinte linha no arquivo / etc / default / docker DOCKER_OPTS = "docker -Htcp: //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

Depois disso, na página do Jenkins Configure para a nuvem do Docker. Estou tendo o erro a seguir. Por favor, veja o screenshot em anexo insira a descrição da imagem aqui

Respostas:

1 para resposta № 1

no seu caso daemon docker não está considerandoo arquivo / etc / default / docker, você pode verificar meu erro de sintaxe no arquivo acima. mais, execute este cmd e faça um teste uma vez. dockerd -H unix: ///var/run/docker.sock -H tcp: / / 0.0.0.0: 2375 &

antes de disparar comando parar todo o serviço docker e matar contêineres se houver