compose icon indicating copy to clipboard operation
compose copied to clipboard

Add --exclude to docker-compose up

Open philtay opened this issue 10 years ago • 46 comments

I have a Compose file with 10 services. I want to start only 8 of them. I can do docker-compose up srv1 srv2 srv3 srv4 srv5 srv6 srv7 srv8 but it would be better to do docker-compose up --exclude srv9 srv10. Useful syntactic sugar IMO.

philtay avatar Nov 09 '16 17:11 philtay

Is it common that you'd want to start a regular subset? If so then perhaps using extends would help the use case. Compose is meant to model an application / common set of container deployments. Not sure how common wanting to start a project that is missing a couple of containers would be (although happy to be enlightened!).

johnharris85 avatar Nov 11 '16 02:11 johnharris85

Judging by the fact that Compose already supports starting a subset, I would say that it's common enough. Many other commands, not only up, also allow to specify the services by name. The current syntax makes it easy to specify a limited subset of the services (2 or 3) as opposed to a larger one.

philtay avatar Nov 11 '16 10:11 philtay

For my team it's very common to start all services apart of particular one. That's the case where you are developing some microservices and want to run all of them on your machine (using docker-compose) apart of that single one that you are currently developing and running from your IDE (for example in the debug mode). So that's :+1: from me for --exclude. But that --exclude should also override dependencies - if I don't want to start something it should never start :)

pmzajaczkowski avatar Feb 11 '17 17:02 pmzajaczkowski

I'm facing the same situation as @pmzajaczkowski. Having this feature is quite useful when testing microservices locally.

yohanliyanage avatar Sep 07 '17 04:09 yohanliyanage

+1 on suggestion. Definitely useful for my team

DemianTinkiel avatar Dec 20 '17 10:12 DemianTinkiel

+1

echo-xu-eb avatar Jan 03 '18 22:01 echo-xu-eb

+1

DutchKevv avatar Feb 15 '18 23:02 DutchKevv

+1

My use case is that we have a handful of microservices, and I'm developing one of them. I want to docker-compose up --exclude <service under development>, which I then start myself; for clearer logging, custom environment, under hot-reload modes, etc.

rangerscience avatar Feb 19 '18 22:02 rangerscience

Second that.

er1z avatar Mar 03 '18 15:03 er1z

This would be super helpful.

Would appreciate if you guys consider this for a future release.

cassiocardoso avatar Apr 24 '18 16:04 cassiocardoso

+1

TVictor avatar May 02 '18 12:05 TVictor

Workaround:

 docker-compose up --scale foo=0

serbaut avatar May 21 '18 09:05 serbaut

+1

Flaque avatar Aug 06 '18 21:08 Flaque

+1

evilosa avatar Aug 08 '18 12:08 evilosa

+1

adithepnarula avatar Aug 09 '18 14:08 adithepnarula

+1

sbz avatar Aug 27 '18 11:08 sbz

+1

arcanjoaq avatar Aug 27 '18 17:08 arcanjoaq

+1

stidiovip avatar Aug 28 '18 11:08 stidiovip

+1

arturdrozdzyk avatar Nov 18 '18 23:11 arturdrozdzyk

+1

aleksandrmetik avatar Feb 06 '19 11:02 aleksandrmetik