I created a docker image to run crontab based on the official nginx image.
FROM nginx
RUN apt-get update && apt-get -y install cron
CMD ["cron", "-f"]
If I don't set the last line CMD ["cron", "-f"], the crontab service can't start after running it as a container. But if I set it, nginx can't start.
docker build -t some-content-nginx .
docker run --name some-nginx -d -p 8080:80 some-content-nginx
(Nginx isn't running)
How to start these 2 services together?