Skip to content

cron job doesn't run #3

@pensnarik

Description

@pensnarik

Container runs successfully but cron job doesn't run:

[mutex@asus docker-cron]$ (master)$ docker build . -t cron2
Sending build context to Docker daemon  70.66kB
Step 1/9 : FROM ubuntu:latest
 ---> 4e5021d210f6
Step 2/9 : RUN apt-get update
 ---> Using cache
 ---> 5d1d1ebb5852
Step 3/9 : RUN apt-get install cron
 ---> Using cache
 ---> 10cbf1b3d807
Step 4/9 : ADD crontab /etc/cron.d/simple-cron
 ---> d81455467c1f
Removing intermediate container 6e8f6786c915
Step 5/9 : ADD script.sh /script.sh
 ---> 64f906dcfd33
Removing intermediate container 56863a415a91
Step 6/9 : RUN chmod +x /script.sh
 ---> Running in c0c2a49087ef
 ---> 28c827f0c7bc
Removing intermediate container c0c2a49087ef
Step 7/9 : RUN chmod 0644 /etc/cron.d/simple-cron
 ---> Running in 1e22e04268ed
 ---> 388c7ecfe97e
Removing intermediate container 1e22e04268ed
Step 8/9 : RUN touch /var/log/cron.log
 ---> Running in ee65d6f0ba33
 ---> 23d090297ad0
Removing intermediate container ee65d6f0ba33
Step 9/9 : CMD cron && tail -f /var/log/cron.log
 ---> Running in f5289dbf139d
 ---> 65e72646a4ec
Removing intermediate container f5289dbf139d
Successfully built 65e72646a4ec
Successfully tagged cron2:latest
[mutex@asus docker-cron]$ (master)$ docker run -it cron2

I've been waiting for 5 minutes but nothing happened.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions