{"action":"created","issue":{"url":"https://api.github.com/repos/docker/compose/issues/5246","repository_url":"https://api.github.com/repos/docker/compose","labels_url":"https://api.github.com/repos/docker/compose/issues/5246/labels{/name}","comments_url":"https://api.github.com/repos/docker/compose/issues/5246/comments","events_url":"https://api.github.com/repos/docker/compose/issues/5246/events","html_url":"https://github.com/docker/compose/issues/5246","id":263714730,"number":5246,"title":"docker compose down does not remove volumes when compose project spans multiple files","user":{"login":"jaloren","id":6081083,"avatar_url":"https://avatars3.githubusercontent.com/u/6081083?v=4","gravatar_id":"","url":"https://api.github.com/users/jaloren","html_url":"https://github.com/jaloren","followers_url":"https://api.github.com/users/jaloren/followers","following_url":"https://api.github.com/users/jaloren/following{/other_user}","gists_url":"https://api.github.com/users/jaloren/gists{/gist_id}","starred_url":"https://api.github.com/users/jaloren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaloren/subscriptions","organizations_url":"https://api.github.com/users/jaloren/orgs","repos_url":"https://api.github.com/users/jaloren/repos","events_url":"https://api.github.com/users/jaloren/events{/privacy}","received_events_url":"https://api.github.com/users/jaloren/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-10-08T12:35:28Z","updated_at":"2017-10-09T23:54:37Z","closed_at":null,"author_association":"NONE","body":"I have two docker compose files. I plan to do a docker-compose up on both files where the project name is the same.\r\n\r\nHere's the first compose file.\r\n\r\n```\r\nversion: '3.3'\r\nservices:\r\n  alpha:\r\n    image: centos:7\r\n    entrypoint: /usr/bin/bash\r\n    command: -c 'sleep 600000'\r\n    volumes:\r\n      - xyz:/opt/bar\r\nvolumes:\r\n  xyz:\r\n```\r\n\r\nHere's the other compose file.\r\n\r\n```\r\nversion: '3.3'\r\nservices:\r\n  beta:\r\n    image: centos:7\r\n    entrypoint: /usr/bin/bash\r\n    command: -c 'sleep 600000'\r\n```\r\n\r\nHere are the commands I executed:\r\n```\r\n docker-compose -p proj -f compose2.yml up -d\r\n docker-compose -p proj -f compose1.yml up -d\r\n docker-compose -p proj -f compose1.yml down --volumes\r\n```\r\n\r\nSince the volume is not used in compose2.yml, expectation is that the volume would be removed when executing the down command for compose1.yml. \r\n\r\n\r\nHere's version output:\r\n```\r\ndocker-compose version 1.16.1, build 6d1ac21\r\n\r\nClient:\r\n Version:      17.09.0-ce\r\n API version:  1.32\r\n Go version:   go1.8.3\r\n Git commit:   afdb6d4\r\n Built:        Tue Sep 26 22:40:09 2017\r\n OS/Arch:      darwin/amd64\r\n\r\nServer:\r\n Version:      17.09.0-ce\r\n API version:  1.32 (minimum version 1.12)\r\n Go version:   go1.8.3\r\n Git commit:   afdb6d4\r\n Built:        Tue Sep 26 22:45:38 2017\r\n OS/Arch:      linux/amd64\r\n Experimental: false\r\n```"},"comment":{"url":"https://api.github.com/repos/docker/compose/issues/comments/335320370","html_url":"https://github.com/docker/compose/issues/5246#issuecomment-335320370","issue_url":"https://api.github.com/repos/docker/compose/issues/5246","id":335320370,"user":{"login":"shin-","id":1086876,"avatar_url":"https://avatars3.githubusercontent.com/u/1086876?v=4","gravatar_id":"","url":"https://api.github.com/users/shin-","html_url":"https://github.com/shin-","followers_url":"https://api.github.com/users/shin-/followers","following_url":"https://api.github.com/users/shin-/following{/other_user}","gists_url":"https://api.github.com/users/shin-/gists{/gist_id}","starred_url":"https://api.github.com/users/shin-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shin-/subscriptions","organizations_url":"https://api.github.com/users/shin-/orgs","repos_url":"https://api.github.com/users/shin-/repos","events_url":"https://api.github.com/users/shin-/events{/privacy}","received_events_url":"https://api.github.com/users/shin-/received_events","type":"User","site_admin":false},"created_at":"2017-10-09T23:54:37Z","updated_at":"2017-10-09T23:54:37Z","author_association":"MEMBER","body":"So this is what happens with the 3rd command:\r\n```\r\n$ docker-compose -p helloworld -f compose1.yml down --volumes\r\nStopping helloworld_alpha_1 ... done\r\nWARNING: Found orphan containers (helloworld_beta_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.\r\nRemoving helloworld_alpha_1 ... done\r\nRemoving network helloworld_default\r\nERROR: network helloworld_default id 8004c6ae0d8ae98bade6999d5c5eadcf012ad67aefce837e15a272b077ad7b5a has active endpoints\r\n```\r\n\r\nSince we encounter an error while attempting to remove the network (because it's obviously still connected to the `beta` container), the program aborts immediately. Volume deletion would have happened after that.\r\n\r\nI'm not sure how to classify this issue - the way you're using 2 independent compose files under the same project name is unconventional and not really something we've envisioned supporting. But that doesn't necessarily mean the behavior is correct as it is."}}
{"actor":{"display_login":"shin-"}}