Docker Swarm Job support is almost here. Let’s test it out.

Support for running “one-off” jobs in Docker Swarm is one of the most long awaited features in Swarm. The code will be included in Docker 20.03.0 but is available now for testing. Using Multipass : https://multipass.run you can setup a 3 node Docker Swarm in a few minutes and start playing about with Swarm Jobs.

Install Multipass

Instructions can be found here : https://multipass.run.

Download a Recent Docker Snapshot

Snapshots are available here : https://github.com/AkihiroSuda/moby-snapshot/releases

Since we are planning to run our Swarm cluster on Ubuntu VMs let’s download the Docker .deb packages from here : https://github.com/AkihiroSuda/moby-snapshot/releases/download/snapshot-20200818/moby-snapshot-ubuntu-focal-x86_64-deb.tbz and extract the .tbz bundle using : tar -xvf moby-snapshot-ubuntu-focal-x86_64-deb.tbz

Start 3 VMs

multipass launch — mem 1G — cpus 1 — disk 10G — name swarm-node-1 20.04

multipass launch — mem 1G — cpus 1 — disk 10G — name swarm-node-2 20.04

multipass launch — mem 1G — cpus 1 — disk 10G — name swarm-node-3 20.04

Mount in the HOME directory from the host to the VM :

multipass mount $HOME swarm-node-1

multipass mount $HOME swarm-node-2

multipass mount $HOME swarm-node-3

On MacOS the above command will mount /Users/ to /Users/ inside each VM.

#docker-swarm #docker #multipass

Docker Swarm Jobs Walkthrough
14.50 GEEK