首页 > 解决方案 > 在 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 无法正确构建。

任何帮助表示赞赏。

标签: dockercrondockerfilealpinesuitecrm

解决方案


推荐阅读