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?

  • Is there a way to make a bootable Linux live USB disk from a Linux docker container?
  • installing cPickle with python 3.5
  • Docker: cannot open port 8080
  • Creating isolated Docker Zones
  • Updating docker images with small changes using commits
  • Environment variables are not recognized by Laravel in Docker
  • Fluentd - Using source tag as index
  • Monolithic (vs) Micro-services ==> Threads (vs) Process
  • How to bundle install a local path gem with docker?
  • Docker Cloud Service Discovery Two Containers
  • apache marathon: my docker image keeps failing
  • Docker & Excelsior JET
  • 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.