2

I have a Jenkins stack running in my Docker Swarm. I want to use the Jenkins Docker Swarm plugin to allow me to use my swarm to spin up slaves, but I cannot figure out the API URI section.

It requires it in the format http://ip:2376 and I can see that my Docker daemon is exposed as the socket but also as tcp://ip:2376 but it can't seem to connect back to the host. I am using Traefik as a reverse proxy and the jenkins is in the proxy network as it has an external URL.

Do I need to add a config to Traefik to allow the container to talk to the host?

Luke
  • 603
  • 2
  • 11
  • 35

1 Answers1

0

You need to expose the docker daemon via tcp on port 2376, try the following:

On your swarm manger node:

vi /etc/systemd/system/docker.service.d/override.conf

The content should be:

[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock -H tcp://0.0.0.0:2376

Then restart docker daemon. When you now exec docker infoyou will get a message like this:

WARNING: API is accessible on http://0.0.0.0:2376 without encryption. ...

Now you can give your jenkins the following URL:

http://your.docker.manager.ip:2376

tigu
  • 731
  • 1
  • 7
  • 20