Docker Community Forums

Share and learn in the Docker community.

Run a docker service on a swarm having several system architectures

I want to test out my distributed algorithm on both my laptop (Linux Mint (Ubuntu) x86_64) and my cluster of Raspberry Pis (HypriotOS armhf) using the new docker swarm mode.

After a bunch of configuration, I can successfully create the swarm cluster, composed of one manager node (the laptop) and N+1 worker nodes (N rasps, plus my laptop). It looks like that:

laptop$ docker swarm init --advertise-addr 192.168.10.1
raspi1$ docker swarm join --token <TOKEN> 192.168.10.1:2377
# [...]
raspiN$ docker swarm join --token <TOKEN> 192.168.10.1:2377

Now, I built two images for my project: an x86_64 one (my_project:x86_64), and an armhf one (my_project:armhf). I really love the nodes/services architecture from this new swarm mode, as creating M (quasi-)independent nodes is exactly what I want, but how can I give the right image to the right node using the docker service create ... command?

From what I see, docker service create only takes one image as parameter! I saw here that I could give a label to each node, and ask a service to use only nodes having this certain label, but it’s not what I want. I would end up managing two clusters of tasks, split by architecture, which would crush my desire of leveraging the swarm mode’s scheduler and dispatcher.

I am a sad geek on his quest to portability, that’s what I am!

Here’s my $ docker version on my laptop:

Client:
 Version:      1.12.3
 API version:  1.24
 Go version:   go1.6.3
 Git commit:   6b644ec
 Built:        Wed Oct 26 22:01:48 2016
 OS/Arch:      linux/amd64

Server:
 Version:      1.12.3
 API version:  1.24
 Go version:   go1.6.3
 Git commit:   6b644ec
 Built:        Wed Oct 26 22:01:48 2016
 OS/Arch:      linux/amd64