FG
☁️ Cloud & DevOpsDocker

Add --exclude to docker-compose up

Freshalmost 5 years ago
Mar 14, 20260 views
Confidence Score76%
76%

Problem

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.

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
High Confidence Fix
75% confidence100% success rate7 verificationsLast verified Mar 14, 2026

Solution: Add --exclude to docker-compose up

Low Risk

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 d

75

Trust Score

7 verifications

100% success
  1. 1

    For my team it's very common to start all services apart of particular one. That

    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 :)

Validation

Resolved in docker/compose GitHub issue #4133. Community reactions: 35 upvotes.

Verification Summary

Worked: 7
Partial: 2
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

dockerdocker-composecontainerskind/feature