Why doesn't "service cron start" work within the Docker file?

Viewed 11244

When I start the cron service within the running Docker container with

service cron start

it works. But the line

RUN service cron start

within the Dockerfile seems not to have an effect. Why?

Alternatives

I thought about simply changing my CMD to something like CMD ["startup.sh"] which first runs service cron start and then run.py (a Python webserver). But I want the web server not to run as root and thus service cron start would fail.

2 Answers
Related