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
When running the command $ docker compose -p <project_name> down <list_services> , it removes all services created with the same <project_name> when it does not find any service that was informed in <list_services>.
Steps To Reproduce
Assuming I have two docker-compose.yml files in different directories: /app1/docker-compose.yml with services: app1, nginx_app1:
And I performed the up of them separately but using the same project_name:
$ cd /app1
$ docker compose -p myproject up -d app1 nginx_app1
$ cd /app2
$ docker compose -p myproject up -d app2 nginx_app2
After that, if I run:
$ docker compose -p myproject ps
I will see all 4 services running.
And if I want to stop only the services of app1, I can naturally do:
$ cd /app1
$ docker compose -p myproject down app1 nginx_app1
However, this works at first because there were services running with the names app1 and nginx_app1, but if I run this same command a second time, docker ends the services of app2. Why? Since I explicitly informed the services of app1 in the command?
I only noticed that this happens when the command no longer finds any services related to app1 running. But in this case, the expected behavior would be for docker to inform that it did not find any services with the names informed for them to be stopped.
Description
When running the command
$ docker compose -p <project_name> down <list_services>
, it removes all services created with the same <project_name> when it does not find any service that was informed in <list_services>.Steps To Reproduce
Assuming I have two docker-compose.yml files in different directories:
/app1/docker-compose.yml
with services:app1
,nginx_app1
:/app2/docker-compose.yml
with services:app2
,nginx_app2
:And I performed the up of them separately but using the same project_name:
$ cd /app1 $ docker compose -p myproject up -d app1 nginx_app1
$ cd /app2 $ docker compose -p myproject up -d app2 nginx_app2
After that, if I run:
I will see all 4 services running.
And if I want to stop only the services of app1, I can naturally do:
$ cd /app1 $ docker compose -p myproject down app1 nginx_app1
However, this works at first because there were services running with the names
app1
andnginx_app1
, but if I run this same command a second time, docker ends the services ofapp2
. Why? Since I explicitly informed the services ofapp1
in the command?I only noticed that this happens when the command no longer finds any services related to app1 running. But in this case, the expected behavior would be for docker to inform that it did not find any services with the names informed for them to be stopped.
Compose Version
Docker Environment
Anything else?
No response
The text was updated successfully, but these errors were encountered: