You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ COMPOSE_PROJECT_NAME=dcprofiles docker compose down
[+] Running 2/1
✔ Container dcprofiles-web1-1 Removed
! Network dcprofiles_default Resource is still in use
=> only web1 is removed
$ COMPOSE_PROJECT_NAME=dcprofiles docker compose down --remove-orphans
[+] Running 2/1
✔ Container dcprofiles-web3-1 Removed
! Network dcprofiles_default Resource is still in use
=> web2 is also removed, no need to specify --remove-orphans
With up the behavior is:
$ COMPOSE_FILE=docker-compose.yml:docker-compose-extra.yml COMPOSE_PROJECT_NAME=dcprofiles COMPOSE_PROFILES=web2 docker compose up -d
[+] Running 4/4
✔ Network dcprofiles_default Created
✔ Container dcprofiles-web3-1 Started
✔ Container dcprofiles-web1-1 Started
✔ Container dcprofiles-web2-1 Started
$ COMPOSE_PROJECT_NAME=dcprofiles docker compose up -d
WARN[0000] Found orphan containers ([dcprofiles-web3-1]) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up.
[+] Running 1/0
✔ Container dcprofiles-web1-1 Running
Description
I would expect services not activated by profiles to be considered orphans, since they don't appear in the output of the
config
command.Current behavior:
docker compose up --remove-orphans
: services in inactive profiles are not removeddocker compose down --remove-orphans
: services in inactive profiles are not removeddocker compose down --project-name <name>
(whether--remove-orphans
is specified or not): services in inactive profiles are removedExpected behavior:
docker compose up --remove-orphans
: services in inactive profiles are removeddocker compose down
: services in inactive profiles are not removeddocker compose down --remove-orphans
: services in inactive profiles are removedAnd it should not depend on the
--project-name
optionSteps To Reproduce
docker-compose.yml
:docker-compose-extra.yml
:=> only web1 is removed
=> web3 is removed but not web2
=> web2 is also removed, no need to specify
--remove-orphans
With
up
the behavior is:=> no container is removed
=>
web3
is removed, but notweb2
=> no special effect of
--project-name
Compose Version
Docker Environment
Anything else?
No response
The text was updated successfully, but these errors were encountered: