forked from likang/docker-cron-awscli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
26 lines (17 loc) · 739 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
FROM ubuntu
# inspired from https://devblog.digimondo.io/how-to-use-environment-variables-in-docker-with-cron-50b20baab430
RUN apt-get update \
&& apt-get install --no-install-recommends -y \
locales tzdata python python-pip cron
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& dpkg-reconfigure -f noninteractive tzdata
RUN pip install pip setuptools --upgrade
RUN pip install awscli --upgrade
COPY start.sh sqs_send.sh sns_send.sh /bin/
RUN chmod +x /bin/start.sh /bin/sqs_send.sh /bin/sns_send.sh
# Add crontab file in the cron directory
ONBUILD ADD crontab.txt /etc/cron.d/thecron
# Give execution rights on the cron job
ONBUILD RUN chmod 0644 /etc/cron.d/thecron
# start script
CMD /bin/bash /bin/start.sh