dockerfile
FROM python:3.6.8
WORKDIR /home
RUN apt-get update \
&& apt-get install -y --no-install-recommends cron \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean \
&& echo "import datetime\nprint(datetime.datetime.now().strftime(\"%Y-%m-%d %H:%M:%S\"))" >> /home/a.py \
&& echo "*/1 * * * * root python3 /home/a.py >> /home/log.txt" >> /etc/crontab
ENV LC_ALL C.UTF-8
CMD PYTHONIOENCODING=utf-8 /etc/init.d/cron start && touch log.txt && tail -f log.txt
标签:log,get,python,apt,&&,home,docker,txt,安装
From: https://www.cnblogs.com/lyalong/p/16912961.html