Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how do you quit docker-compose up @ macOS?

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.

like image 874
m1well Avatar asked Oct 23 '17 21:10

m1well


People also ask

How do I stop docker composer on Mac?

To prevent Compose from picking up changes, use the --no-recreate flag. If you want to force Compose to stop and recreate all containers, use the --force-recreate flag. If the process encounters an error, the exit code for this command is 1 .

How do I get out of Docker compose up?

Starting and Stopping Docker Compose You can stop it using CTRL+C (run once for the preferable graceful shutdown, or twice to force-kill). You can start Docker Compose in the background using the command docker-compose up -d . If using this method, you'll need to run docker-compose stop to shut it down.

How do I stop Docker compose down?

Options. Remove containers for services not defined in the Compose file. Remove named volumes declared in the volumes section of the Compose file and anonymous volumes attached to containers.

How do I get out of docker?

To exit out of the docker container bash shell. Just run exit or hit ctrl-D like you normally would.


1 Answers

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.

like image 176
mkasberg Avatar answered Oct 01 '22 11:10

mkasberg