Docker Community Forums

Share and learn in the Docker community.

Deployment to multiple hosts with USB devices

I am currently developing a software which runs on up to 10 identical devices at once in a local network. Each device is an Ubuntu 18:04 machine with arm64 architecture. As the software requires ubuntu20:04 and it is not possible to upgrade the host, the software runs inside a docker container. So far, I always copied the entire project forlder to each device, created an image and ran it. It works but it is very time consuming and annoying.

I recently read an article about docker swarm so I was wondering, if I could deploy the image to all devices at once with it. I already created a swarm but I have some trouble setting everything up:
Every device has a USB device plugged in which I need to access inside the docker container. Within docker run I accomplished that with the ‘–device’ parameter. This however does not seem to be possible with swarm services as I read in some GitHub issues.

Is there any other way I can deploy the image to every device? I only need the automatic deployment of the images.

Some further information:

  • the docker container must continue to run even if the device temporarily looses connection to the network.

  • every device needs to use the host network (’–network host’)

  • I need to deploy from a different architecture amd64 ( I currently use buildx for that )

  • the network has no access to the internet

  • log files need to be stored persistent ( in volumes )

Thanks for some advice in advance

Swarm does not distribute images amongst nodes and yes, it can not use the --device option (see: [epic] add more options to `service create` / `service update` · Issue #25303 · moby/moby · GitHub)

What you need is a private container image registry. Though this will require your devices to be connected to a shared network.

I am already using a local registry which I originally used to deploy it with swarm. ( My image name was )
Is there any option to manually trigger an update of the image and re restart on every device?
My devices are all in a shared network.