一个例子
FROM ubuntu:20.04 WORKDIR /root COPY ./sources.list /etc/apt/sources.list COPY ./cron-start.sh /opt/cron-start.sh ARG DEBIAN_FRONTEND=noninteractive ENV TZ=Asia/Shanghai RUN apt-get update && \ apt-get install -y python3 python3-pip vim cron && \ pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple playwright && \ pip3 install -i https://pypi.douban.com/simple pyquery && \ playwright install chromium && \ playwright install-deps chromium && \ sed -i 's/required/sufficient/g' /etc/pam.d/cron && \ chmod +x /opt/cron-start.sh ENTRYPOINT ["/opt/cron-start.sh"]
加上这两行就行了
ARG DEBIAN_FRONTEND=noninteractive ENV TZ=Asia/Shanghai标签:&&,dockerfile,apt,cron,start,sh,install,软件,安装 From: https://www.cnblogs.com/regit/p/18023567