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
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.