Docker compose down specific service

Hi Dear
Is this below command correct for down only specific service with docker-compose?

docker-compose down service-name

I guess your answer is at docker compose down | Docker Documentation.

You may want docker compose stop | Docker Documentation.

Thanks for your respond ! But i know in docker compose we have docker-compose up specifict-service i want to know could i run docket-compose down sepecifit-service for stop only one service in docker compose file?

docker-compose down is not used for what you are looking for. Please look at the 2nd link @avbentem posted.

If people take the time to respond and even address things they assume you might have ment, then please at least take the time to value their input and check wether it makes sense for your situation.

1 Like

You may also want to compare the documentation for docker compose up | Docker Docs with that of docker compose down | Docker Docs, to see that one mentions [SERVICE...] while the other does not.

This the part that confuses me. What is the difference between [SERVICES] and [SERVICE]. It seems to me, docker-compose down is not intend to specific service. Then what could be the value for [SERVICES]?

Probably an error in the documentation. You will not see that when you run

docker compose down --help

Just checked their doc, it seems 2.19.0 just introduce ability to select service to be stopped by compose down

1 Like

Good to know. Thanks for the link.