为什么我的Docker容器没有运行cron脚本,但是当我对cron重新启动进行服务时却会运行?

问题描述

当我进入容器时,Cron不是正在运行的进程,但是当进入容器并bash service cron restart开始运行时,我不知道为什么它不能与{{ 1}},但不是没有?

Dockerfile

service cron restart

我的hello-cron脚本

FROM ubuntu:bionic

RUN apt-get update && apt-get -y install \ 
    cron \
    nano \
    psmisc \
    wget

COPY hello-cron /etc/cron.d/hello-cron

# Give execution rights on the cron job
RUN chmod +x /etc/cron.d/hello-cron

# Apply cron job
RUN crontab /etc/cron.d/hello-cron

# Create the log file to be able to run tail
CMD ["cron","-f"]

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...