Cron não executa no container
Tenho um container laravel em que preciso executar schedules mas sempre que o container inicia recebo o seguinte erro no log:
seteuid: Operation not permitted
Starting periodic command scheduler: cron failed!
[12-Dec-2023 13:35:50] NOTICE: [pool www] 'user' directive is ignored when FPM is not running as root
[12-Dec-2023 13:35:50] NOTICE: [pool www] 'user' directive is ignored when FPM is not running as root
[12-Dec-2023 13:35:50] NOTICE: [pool www] 'group' directive is ignored when FPM is not running as root
[12-Dec-2023 13:35:50] NOTICE: [pool www] 'group' directive is ignored when FPM is not running as root
[12-Dec-2023 13:35:50] NOTICE: fpm is running, pid 13
[12-Dec-2023 13:35:50] NOTICE: ready to handle connections
Fiz a instalação do cron:
tentei instalar o cron no container:
johnny@792fb8fb0cd:/var/www$ apt-get install -y cron
E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?
johnny@792fb8fb0cd:/var/www$ sudo apt-get update && sudo apt-get install -y cron
bash: sudo: command not found
Olá, Johnny! Tudo bem?
Sugiro outra abordagem, veja o que fiz aqui nessa aula: https://academy.especializati.com.br/aula/rodar-comando-do-laravel-todos-os-dias-com-scheduling
Precisa estar logado para conseguir responder a este ticket!
Clique Aqui Para Entrar!