在把自己的项目通过Docker进行打包时,由于项目中用到了crontab,不过使用到的基础镜像python:3.6-slim
并没有安装这项服务,记录下在镜像中安装和配置crontab的过程。
Dockerfile
由于基础镜像中没有crontab服务,需要在打包自己镜像的Dockerfile中加入安装cron服务的步骤。
FROM python:3.6-slim
MAINTAINER whx3000 <wanghaoxi3000@163.com>
RUN apt-get update && \
apt-get install -y --no-install-recommends \
cron && \