afzalex
afzalex

Reputation: 8652

docker compose down specific profile

When I try to docker compose down specific profile, it stops and removes all container. I want to remove only containers that are in referred profile.

docker compose --profile elk down         # Let's say I have some services in elk profile

In above example I wanted to bring down only services that are tagged with elk profile.

Upvotes: 5

Views: 4144

Answers (3)

Emmanuel BRUNET
Emmanuel BRUNET

Reputation: 1406

Using docker compose 2.16.0, I got it working by pointing the docker compose file :

docker compose -f my-compose-file.yaml --profile my-profile down

Upvotes: 4

Ricardo Marques
Ricardo Marques

Reputation: 41

Same issue here (not really an answer). Alternatively it would be great to have docker compose --profile foo up --remove-orphans or similar also working.

There was a similar issue about it but it literally just got closed due to inactivity:

https://github.com/docker/compose/issues/8432

Upvotes: 2

matic1123
matic1123

Reputation: 1119

We have been experiencing the same issues. I followed the thread on the bug report. It looks like it was not solved yet.

We moved from using compose to swarm (multiple 1 node manager clusters instead of only using compose). And since now we use stacks we don't need profiles anymore.

Upvotes: 0

Related Questions