Last active
July 31, 2021 18:08
-
-
Save Tbruno25/f7a1195951a578d188f13da967fe1223 to your computer and use it in GitHub Desktop.
Use cron inside ubuntu docker container
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#assuming you have some script you want to run with cron | |
FROM ubuntu:latest | |
WORKDIR /app | |
COPY . . | |
RUN apt-get update | |
RUN apt-get install -y cron | |
RUN echo "* * * * * ./app/some-script" >> /etc/cron.d/app | |
RUN chmod 0644 /etc/cron.d/app | |
RUN crontab /etc/cron.d/app | |
CMD ["cron", "-f"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment