Short story long: I have a little project here that needs static website serving. So I set up an nginx docker container on main dev machine (XUbuntu). Working fine when created with
docker run -p 5000:80 -v /someprojectpath:/usr/var/nginx/html:ro --name myweb nginx
Then I had a spare Raspberry Pi and figured "hm, why not pull up a notch and run that container on the pi?" Said and done: Installed docker client on the pi through
curl -sSL https://get.docker.com | sh
I then created a folder on the pi (original Raspberry Pi 2B with 8GB SD-Card, up-to-date Raspbian) in /home/pi/www and put that in above mentioned command:
docker run -p 80:80 -v /home/pi/www:/usr/var/nginx/html:ro --name myweb nginx
But this time, the container just exits after a few seconds without serving.
I searched a bit and found some remarks about "daemon:off" but when I checked the container, it is already running with "daemon:off" (or at least it should - no idea how to verify that).
Why is the behavior different? And how do I fix the early exit?
Update
Just for fun, I tried docker run hello-world
. It did not give any output!
I inspected both images (hello-world and nginx) and confirmed "Architecture" = arm
.