Skip to content

feat: add --profiles-only flag to stop and restart commands - #14000

Open
glours wants to merge 1 commit into
docker:mainfrom
glours:stop-profiles-only
Open

feat: add --profiles-only flag to stop and restart commands#14000
glours wants to merge 1 commit into
docker:mainfrom
glours:stop-profiles-only

Conversation

@glours

@glours glours commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

What I did
Acting on only the services of a profile currently requires naming each service explicitly, as --profile x stop or --profile x restart also target services without profiles (#13993, previously #12648).

The new flag restricts both commands to services enabled by a profile: the active profiles when some are set via --profile or COMPOSE_PROFILES, otherwise services from all profiles. Services without profiles are never affected. down intentionally keeps its whole-application semantics.

Related issue
fixes #13993

(not mandatory) A picture of a cute animal, if possible in relation to what you did
image

Acting on only the services of a profile currently requires naming
each service explicitly, as `--profile x stop` or `--profile x
restart` also target services without profiles (docker#13993, previously
docker#12648).

The new flag restricts both commands to services enabled by a
profile: the active profiles when some are set via --profile or
COMPOSE_PROFILES, otherwise services from all profiles. Services
without profiles are never affected. `down` intentionally keeps its
whole-application semantics.

Signed-off-by: Guillaume Lours <glours@users.noreply.github.com>
@codecov

codecov Bot commented Aug 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 82.60870% with 8 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/compose/restart.go 42.85% 2 Missing and 2 partials ⚠️
cmd/compose/profiles_only.go 93.75% 1 Missing and 1 partial ⚠️
cmd/compose/stop.go 71.42% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

direct command to compose down services a specific profile without down default services

1 participant