Docker Swarm: easy container orchestration

Easy container orchestration

At SUE we love containers; and for our customers we manage loads of them. This is why we understand the value of good orchestration tools. For medium to large scales we recommend Kubernetes, without a doubt. However, on smaller scales Kubernetes can be too complex, which is why in this article we are going to explore a lesser known container orchestrator called Docker Swarm.

Docker Swarm

Docker Swarm is a mode of Docker that allows you to turn your servers running the Docker Engine into a cluster. Docker Swarm is easy to use (just use the ‘docker’ command); and highly integrated with the rest of the Docker ecosystem, which means you can use your existing tools like Docker Compose, Portainer, and Traefik. You can even build your own integrations thanks to SwarmKit.

A node in Docker Swarm can either have the role of a manager or a worker. The manager’s nodes make scheduling decisions and manage the state of the cluster via the Raft consensus protocol. Manager nodes can also run containers, and store persistent container data. Worker nodes can only run containers and store container data, and they can only make decisions if you promote them to a manager.

With Docker Swarm you can apply several deployment strategies: As an individual container on a specific node (like ‘docker run’), as a replicated service (where you can specify the desired number of replicas), or as a global service (where the container runs on each node in the cluster). You can also use the ‘docker stack’ command which is the Docker Swarm variant of Docker Compose.

Containerized sea shanty

As a container orchestrator, the central unit of Docker Swarm is the container. Containers in the operational sense are self contained units of software that you can run (almost) anywhere. This aspect of being self-contained, makes classical operational tasks such as updating much easier.

From a technical perspective containers are not directly implemented. Linux implements the building blocks that make up a container, but it is the container engine (like Docker) that implements the actual container. Containers on Linux are implemented via so called namespaces and cgroups. Namespaces determine what part of the overall system you can see/interact with, and cgroups provide process accounting and constraints (like limiting CPU and memory usage). The namespaces that are implemented: Mount (Filesystem), Pid (Process), Net (Network), IPC (Message queues and shared memory), and User (User and groups).

Because namespaces and cgroups are just building blocks you can create minimal container engines like Chroot, or more sophisticated ones like Containerd or Docker.

A swarm of anecdotes

  • Docker Swarm is made for situations where managing individual Docker Engines is too inconvenient, but where adding Kubernetes would introduce overhead in complexity. For example when:
    • You have a defined workload, that is not likely to change.
    • Your (legacy) application does not need significant scalability.
    • You make use of Docker/Docker Compose.
    • You want an economic container platform.
    • You want to manage your Docker Engines as one unit.
  • A lesson learned from Kubernetes networking is the use of a single cluster-wide network to publish all services. It both simplifies inter-service communication and reduces inter node communication.
  • Traefik and Portainer running on a Swarm manager node makes for a great management plan. Because of their native support for Docker Swarm they can detect, manage, and connect containers running on the cluster.
  • With bind mount volumes you can use node-specific persistent storage. Which is useful when you have non uniform storage setups.
  • Service discovery features make it possible to communicate with the right container even when running multiple instances of those containers.
  • At SUE we use Docker Swarm for our managed service platform specifically so that we can focus on the needs of the customer.

Join the swarm

Are you in need of advice or support on the subject of developing and operating container infrastructure? Our team of experts can assist with everything from setting up the necessary infrastructure to providing ongoing support and maintenance.

Stay up to date
By signing up for our newsletter you indicate that you have taken note of our privacy statement.

Any questions? Contact us!

Nick Methorst

Let's talk!


Any questions? Contact us!

* required

By sending this form you indicate that you have taken note of our privacy Statement.
Privacy Overview
This website uses cookies. We use cookies to ensure the proper functioning of our website and services, to analyze how visitors interact with us, and to improve our products and marketing strategies. For more information, please consult our privacy- en cookiebeleid.