Cronjob in symfony running on docker

I am trying to run a symfony command through cron but it is now executing never. The application is runningin docker and I can’t find information if I need to specify roles or something else. Other standard linux commands are executed successfully but looks like cron doesn’t want to start app/console. Here is my cronjob:

*  * * * * /usr/local/bin/php /usr/lib/myApp/app/console myCommand --env=prod >> /usr/lib/myApp/testLog.txt 2>&1

Does anyone have any suggestions how to run symfony command in docker using cron?

  • Docker for Mac: x509: certificate signed by unknown authority error
  • Docker: --ipc=host and security
  • How to partition web application in Docker
  • Docker daemon start error on ubuntu 12.04
  • Sequel Pro with Mysql in Docker
  • running solr instance inside docker
  • Nextcould 11 docker “config.php” not working
  • When building Jenkins in Docker plugins fail to install
  • Launch a container with Docker without specifying command
  • Everything inside one docker container or specialized containers
  • when doing docker compose, is it possible to keep previous docker composition
  • View logs for all docker containers simultaneously
  • One Solution collect form web for “Cronjob in symfony running on docker”

    The philosophy of Docker is to have one process per container. That means, you usually have no init system and thus, no services running inside the container, e.g. dbus or cron.

    There are ways to create your own Docker Image with such an init-system/background service. Images based on Alpine often use S6.

    Another solution is to have use the cron-service on your host and rewrite the command to something like docker exec <container_name> /usr/local/bin/php ...

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.