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, 2020 in Docker by kartik
• 37,510 points
4,984 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, 2020 by Niroj
• 82,880 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
• 10,610 points
3,246 views
+14 votes
19 answers

How can I run a ‘docker exec’ command inside a docker container?

you can run any command in a ...READ MORE

answered Dec 10, 2018 in Docker by Pramiti
1,225,002 views
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
• 59,230 points
3,256 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 23, 2019 in Docker by Kalgi
• 52,360 points
1,810 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, 2020 in Docker by MD
• 95,440 points
19,271 views
+2 votes
1 answer
+2 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
• 58,090 points
2,426 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, 2020 in Docker by Niroj
• 82,880 points
18,747 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP