How to run a cron job inside a docker container?

0 votes
Hii,

How to run a cron job inside a docker container?

My container have only cron.daily and cron.weekly file and  crontab,cron.d, cron.hourly are absent in my container

My container runs with /bin/bash.Any help?
May 18 in Docker by kartik
• 16,870 points
101 views

1 answer to this question.

0 votes

Hii,

crond works well with tiny on Alpine

RUN apk add --no-cache tini

ENTRYPOINT ["/sbin/tini", "--"]
CMD ["/usr/sbin/crond", "-f"]

but should not be run as container main process (PID 1) because of zombie reaping problem and issues with signal handling.

Thank You!

answered May 18 by Niroj
• 35,060 points

Related Questions In Docker

0 votes
1 answer

How to run a docker command from inside the container?

You must have come across the /var/run/docker.sock file, ...READ MORE

answered Jun 28, 2018 in Docker by Sophie may
• 9,940 points
1,072 views
+3 votes
13 answers
0 votes
2 answers

How to execute docker exec commande inside a docker container ?

You need to get inside the container ...READ MORE

answered Aug 13, 2019 in Docker by Sirajul
• 54,260 points
857 views
0 votes
1 answer

How to create a container and run images in docker?

Look for what all images you have ...READ MORE

answered Feb 22, 2019 in Docker by Kalgi
• 51,890 points
256 views
0 votes
1 answer

How to run firefox inside docker container?

Hi@akhtar, Generally, if you run firefox inside docker ...READ MORE

answered Apr 16 in Docker by MD
• 34,440 points
1,435 views
0 votes
1 answer
0 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 57,530 points
618 views
0 votes
1 answer

Error:Failed to start redis.service Unit redis-server.service is masked

Hello, If redis.service file is missed in directory path /etc/systemd/system/redis.service so we ...READ MORE

answered May 18 in Docker by Niroj
• 35,060 points
344 views