Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I run docker-compose start in foreground?

How can I start services with docker-compose start in foreground like docker start -a does?

like image 297
Downvote Hunter Avatar asked Sep 20 '25 07:09

Downvote Hunter


1 Answers

The docker compose up command already run all containers in foreground by default:

The docker-compose up command aggregates the output of each container (essentially running docker-compose logs -f). When the command exits, all containers are stopped.

The only exception is when using the -d flag:

Running docker-compose up -d starts the containers in the background and leaves them running.

like image 131
Eduardo Baitello Avatar answered Sep 22 '25 20:09

Eduardo Baitello