Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

no suitable node - unable to deploy image using docker service

I have a docker swarm based on raspberry pi 3. I have 3 nodes. I have created an image on my laptop and pushed that to the docker registry.

If I try to start the image on a node in the swarm using docker run it works as expected.

docker run -ti alexellis2/pi-sharp:0.1

but if i try and start it using a docker service it fails.

docker service create --name test alexellis2/pi-sharp:0.1

Error 1/1: no suitable node (unsupported platform on 3 nodes)

If I do an docker inspect on the service it shows this information.

"Placement": {
                    "Platforms": [
                        {
                            "Architecture": "amd64",
                            "OS": "linux"
                        }
                    ]
                },

I have tried to prune containers and images to no avail.

My question is why am I able to use the image using docker run but not using docker service?

like image 521
Henrik Andersen Avatar asked Feb 24 '18 11:02

Henrik Andersen


1 Answers

when you build your in PC, the build environment is x86. if you build the image on the Pi, the build environment and architecture is armhf.

Those images are not cross-platform and this is known problem nowadays. https://developer.ibm.com/linuxonpower/2017/07/27/create-multi-architecture-docker-image/

you might be right that in some scenarios, docker run versus docker service might work strangely (docker service results in error state, docker run works)

like image 64
user1492810 Avatar answered Oct 13 '22 11:10

user1492810