0

I am trying to start cron service on php-fpm docker. This is the sample code I am using :

......
RUN apt update
RUN apt install -y ..... cron

I tried to start the cron in the following ways :

CMD .... && cron -f

and ...

RUN cron -f

but it either fails in building or just don't start cron service.

I also tried with :

cron and service cron start

but with no success.

  • You typically need to run it in a separate container, as the main container `CMD`. The linked question has several examples and alternate paths. – David Maze Jul 18 '22 at 10:42
  • The program name is `crond` – shingo Jul 18 '22 at 10:47
  • I've read a lot threads before asking this question. The issue is that I see the step executing properly : ```Step 20/26 : RUN service cron start``` but then when I check with "service cron status" I see "failed". When I type "service cron start" in the container it works, but I can't do it each time I rebuild. – Dimitar Kalinov Jul 18 '22 at 11:18

0 Answers0