I have a cluster which is being used as a docker swarm - 1 manager, and 4 workers. The manager node is a pure manager node, set via

docker node update --availability drain <manager-id>

The manager has the /usr/lib/systemd/system/docker.service set to start with

ExecStart=/usr/bin/dockerd -H fd:// -H tcp:// --containerd=/run/containerd/containerd.sock

Now I am trying to use this cluster/swarm as a Jenkins cloud provider, so that all jobs run in docker containers in this swarm. In Jenkins, under Configure Clouds, I have create a cloud provider of type "docker", and provided the manager IP address as the docker host uri, eg. tcp://a.b.c.d:2375. There is no error, but when I start a job, it creates a container on the manager itself.

How can I make it so that each container is deployed on a non-manager container?


1 Answer 1


Docker Swarm is a layer over Docker and it manages the creation of containers on nodes given docker service definitions.

As I understand it, Jenkins does not know docker swarm, and simply asks the target node to create containers. Docker swarm, and its orchestration is consequently not involved - everything gets created and scheduled on the target node only.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.