This week I got answers to two questions I had been wondering about regarding docker-compose.

The first is that I like running docker-compose up without the -d flag so I can see if there are any errors or warnings. But then I want to exit without killing the containers. I finally discovered ctrl+\. It will detach without exiting the containers.

The second has to do with the restart flag. Setting restart: always actually restarts the containers if the docker service or host is restarted (I know, read the man pages!). So I’ve happily changed all of my dev docker-compose.yml files to use restart: unless-stopped because I don’t want containers to be restarted if I have manually stopped them.