Docker Compose: Detached Mode (Background)

By default, a Docker Compose starts the services in the foreground mode just like a docker run command.

To run the Docker Compose in the background, a docker-compose up command should be started with the -d or --detach option.

In this short note i am showing how to run the Docker Compose in the detached mode.

Cool Tip: Run a docker-compose command against a single service! Read more →

Docker Compose Detached

Run the docker compose up command in the detached mode (in the background):

docker-compose up -d
- or -
docker-compose up --detach

The command above starts the containers in the background and prints the new container names.

Cool Tip: How to specify a path to the Dockerfile in a Docker Compose! Read more →

Was it useful? Share this post with the world!

Leave a Reply