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?
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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With