Docker with foreman

Is there anyway to stop my container from exiting when running my Rails server with foreman. When foreman does its thing and starts up my rails server and sidekiq it immediately exits with exit code 0 as expected. Is there any way to prevent this behaviour and keep the container running?

  • Docker container stuck after enter in container
  • Why does the new built image does not have the new installed package?
  • Putting databases in their own Docker containers?
  • Can Ansible deploy Docker containers remotely?
  • Docker multi container networking on same host
  • Docker volumes for persistent data - is it enough to pass container path only?
  • Warning message of deprecated link option of Docker
  • Escape character in Docker command line
  • docker runs image on wrong port
  • What is Docker storage driver
  • cf ic plugin not able to find docker daemon while authentication
  • Docker dm_task_run failed error
  • One Solution collect form web for “Docker with foreman”

    In my case it still running after after running Rails and Sidekiq:

    ➜  ~  ps aux | grep foreman
    maxd       2194   0.0  0.2  2486168  29004 s000  S+    2:09PM   0:00.56 foreman: master
    

    Seems like foreman starts in foreground always. May be you problem doesn’t related to foreman (try to check Rails and Sidekiq logs)? How are you running it in Docker container?

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