docker - 在 Docker 容器 alpine 中为 SuiteCRM 运行 cronjobs 时遇到问题
问题描述
我想让 SuiteCRM cronjobs 工作,如果我键入crond -b -d 8
所有计划的作业运行良好。但是,如果我将命令放在我的 php Dockerfile 中它不起作用(即使作为 root)。
PHP Dockerfile 的代码:
RUN apk add --update busybox-suid
COPY cronjobs /etc/crontabs/www-data
RUN chmod 0644 /etc/crontabs/www-data
CMD ["sh", "init.sh"]
RUN crond -b -d 8
初始化.sh:
#!/bin/sh
# repair/rebuild suitecrm
./vendor/bin/robo repair:database
./vendor/bin/robo repair:rebuild-extensions
./vendor/bin/robo repair:rebuild-relationships
php-fpm
我不能使用 CMD,因为你只能在 Dockerfile 中使用一个 CMD。我也尝试过放入crond -b -d 8
我的 init.sh 但这会导致 Suitecrm 无法正确构建。
任何帮助表示赞赏。
解决方案
推荐阅读
- python - Dataframe 和系列的 Pandas 组合
- c# - 创建 SQLite 表 Xamarin 表单
- angularjs - '角度未定义'
- maven - Maven Surefire 仅“默认测试”运行自定义执行被忽略
- java - 如何从 Java 访问 COM 自动化 DLL?
- apache-spark - spark如何与集群配置一起工作?
- javascript - 单击键/按钮时如何播放每个声音?
- hadoop - 结构中的 hive 处理时间戳列的错误?
- computer-vision - 我可以微调像 Resnet 和 Vgg19 这样的预训练分类 CNN 来预测图像中的某些角度吗?
- ruby - 我如何知道地理编码器结果是否只是城市名称的匹配项?