FROM ubuntu:latest
RUN apt-get update && \
apt-get -y install cron tzdata && \
rm -rf /var/lib/apt/list/* && \
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
dpkg-reconfigure --frontend noninteractive tzdata
#COPY rm-file.sh /root/rm-file.sh
COPY checklog-cron /etc/cron.d/checklog-cron
#RUN chmod +x /root/rm-file.sh
RUN chmod 0644 /etc/cron.d/checklog-cron
RUN touch /var/log/cron.log
RUN crontab /etc/cron.d/checklog-cron
# Run the command on container startup
CMD cron && tail -f /var/log/cron.log