Questions tagged [docker-swarm]

Docker Swarm is native clustering for Docker. It turns a pool of Docker hosts into a single, virtual host.

Docker Swarm is native clustering for Docker. It turns a pool of Docker hosts into a single, virtual host.

Swarm serves the standard Docker API, so any tool which already communicates with a Docker daemon can use Swarm to transparently scale to multiple hosts: Dokku, Compose, Krane, Flynn, Deis, DockerUI, Shipyard, Drone, Jenkins... and, of course, the Docker client itself.

Like other Docker projects, Swarm follows the "batteries included but removable" principle. It ships with a set of simple scheduling backends out of the box, and as initial development settles, an API will be developed to enable pluggable backends. The goal is to provide a smooth out-of-the-box experience for simple use cases, and allow swapping in more powerful backends, like Mesos, for large scale production deployments.

3165 questions
7
votes
3 answers

Creating a swarm cluster with Docker for Mac

I've been trying to follow this tutorial: https://docs.docker.com/engine/swarm/swarm-tutorial/ Instead of running it on some real linux hosts or local VMs I want to network a couple of MacBooks running Docker desktop for Mac. Following the tutorial…
justinhj
  • 11,147
  • 11
  • 58
  • 104
7
votes
1 answer

How to share local files to docker container In swarm with docker-compose

here is my docker compose file version: '2' services: demoui: image: demoimage ports: - "80:8000" volumes: - ./democonfig/config.js:/usr/local/tomcat/webapps/demo-ui/config.js - ./logs/demo-ui:/usr/local/tomcat/logs restart:…
vimal prakash
  • 1,503
  • 1
  • 22
  • 38
7
votes
2 answers

Docker swarm: How to manually set node names?

For some background on my environment: I have docker swarm running on 3 ubuntu 14.04 vagrant boxes. The swarm master is running on 1 machine (with consul) and the other 2 machines are running swarm workers that are joined to the master. I set up…
Alex Cohen
  • 5,596
  • 16
  • 54
  • 104
7
votes
1 answer

How do I run a docker swarm node on the same machine as the swarm manager?

I have been following these instructions to set up a docker swarm on my Ubuntu machine. I'd like to run some swarm nodes on the same machine that is running the swarm manager, but the status of the nodes are "Pending" with the error "Cannot connect…
jp.rider63
  • 574
  • 3
  • 20
6
votes
0 answers

how to allow both host networking and ingress in docker swarm?

I have a small network of computers, bundled into a docker swarm. I'm running a service that needs host networking, which is fine when it runs on a dedicated node. But I want to let it run on any node - yet maintaining the ability to access its web…
mortee
  • 61
  • 3
6
votes
1 answer

What does the Docker sleep command do?

I can't find a clear explanation as to what the Docker sleep command does so can someone explain please? For example: docker container run -d alpine sleep 1d I have had a look online but I can't find a simple explanation.
Elena
  • 261
  • 1
  • 3
  • 12
6
votes
0 answers

Service placement on leader manager node in Docker Swarm

In a docker-compose.yml file, is there a way to constrain the placement of a service to not just a manager node, but the leader manager node? For instance, this will constrain to any manager node: version: '3.5' services: my_cool_service: …
Turgs
  • 1,729
  • 1
  • 20
  • 49
6
votes
1 answer

How can I use Sticky sessions on Docker using Traefik v2.3?

How can I use Sticky sessions in Traefik v2.3? When I enable the below line in my docker compose file, my docker services (e.g. http://192.168.0.1:9086) don't work. - "traefik.http.services.mynginximage2.loadBalancer.sticky.cookie=true" Do you have…
6
votes
1 answer

Docker ERROR: only one instance of "host" network is allowed

I am trying to run a container where I need to user network driver as "host" instead of "bridge". I am running it on Centos machine and my docker-compose.yml is version: '3.4' services: testContainer: build: context: . args: …
sanjeev kumar
  • 373
  • 1
  • 6
  • 21
6
votes
1 answer

Enable forwarding from Docker containers to the outside world

I've been wondering why docker installation does not enable by default port forwarding to containers. To save you a click, what I mean is: $ sysctl net.ipv4.conf.all.forwarding=1 $ sudo iptables -P FORWARD ACCEPT I assume it is some sort of…
6
votes
1 answer

How to ensure two docker containers don't process the same file?

So I have two services A and B in a swarm. A has 5 instances and so does B. They both access files from a common mount. If I put a 100 files in this mount, how do I ensure that the files A and B pick (maybe 50 each) are mutually exclusive i.e the…
Loki
  • 61
  • 3
6
votes
1 answer

Traefik 2.0 and Docker set middleware without naming the router

I'm using traefik 2.0 with docker provider (swarm mode) and I wish to provide a default way for services publishing themselves on traefik avoiding conflicts. I managed to create a default rule matching my needs, but I'm now struggling because I…
6
votes
7 answers

container running on docker swarm not accessible from outside

I am running my containers on the docker swarm. asset-frontend service is my frontend application which is running Nginx inside the container and exposing port 80. now if I do curl http://10.255.8.21:80 or curl http://127.0.0.1:80 from my host…
6
votes
1 answer

Run Linux containers in an Azure DevOps Windows hosted build agent

I'm using Azure DevOps, and have a Linux build pipeline (ubuntu-16.04) setup that builds the code, starts containers with Docker Compose, then runs integration tests using the containers. This all works great. Now I want to setup a Windows build…
Cocowalla
  • 13,822
  • 6
  • 66
  • 112
6
votes
0 answers

Docker service restart policy - stop old service when new service is really ready

I have tomcat running as docker service in a swarm. When the service starts it loads lots of data into memory, which can take depending on the amount of data between 10 and 30 minutes. My problem is when I update the service (order:start-first) the…