14

after docker-compose up, on windows i quit that with "CTRL+C" and the container(s) are still running. When i do this on my mac, then docker kills my container :(

I tried it now with a shell script, which executes the docker-compose up into "echo", but on some container, the scripts hang up.

How do you do that? Are there any best practices? (suitable with windows)

Thanks a lot.

1 Answer 1

28

If you want to run docker-compose up and leave the process running without being attached to your terminal, you can run it in detached mode with docker-compose up -d.

https://docs.docker.com/compose/reference/up/

After doing so, you'd have to use docker-compose stop or docker-compose down to stop your running containers, since CTRL+C won't kill them.

1
  • ah ok the "-d" flag seems to be fine for this behavior. thanks :)
    – m1well
    Oct 23, 2017 at 21:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.