2

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.

2 Answers 2

1

Append this at the end of your docker run command:

-g 'daemon off;'

It should be in this syntax not "daemon:off" as you mentioned.

Hope that helps

1
  • Didn't help. I didn't expect it to do, though. There must be something else, I am missing. The syntax from question is from docker inspect.
    – Fildor
    Commented Oct 29, 2020 at 15:20
0

Found the answer.

On a Raspberry Pi 2 , you need explicitly images for ARM v6.

So I came across arm32v6/nginx which resulted in a missing manifest error.

Next step was to opt for an explicit version, for example arm32v6/ngninx:stable-alpine.

And that finally did the trick!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .