Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a way to remove one-off containers created by docker-compose run #2774

Closed
dnephin opened this issue Jan 28, 2016 · 5 comments
Closed

Comments

@dnephin
Copy link

dnephin commented Jan 28, 2016

Related to: #2593 and #943
Copied from: #2568, #2184

One-off containers created by docker-compose run are not removed by default, and aren't removed by docker-compose rm.

We should do at least one of the following:

  1. Make --rm flag default for fig run #943 - make --rm the default for run
  2. add a flag to rm to include one-off containers
  3. remove one-off containers as part of rm by default
@dnephin
Copy link
Author

dnephin commented Jan 28, 2016

I don't have a strong preference for any of these, but I think we should do at least one of them for 1.7

@Visgean
Copy link

Visgean commented Feb 14, 2016

There are some other options:

  • create another command with this behaviour - something like execute
  • let users choose the behaviour in docker-compose config file

@mixja
Copy link

mixja commented Feb 16, 2016

Another issue is even if you use docker-compose run --rm to remove the container, any volumes in the container are left behind as dangling volumes.

docker-compose rm -f -v does not deal with these dangling volumes, nor does docker-compose down

Note this does not reflect the behaviour of docker run --rm, which does remove volumes

@Kukunin
Copy link

Kukunin commented Mar 24, 2016

I vote for 2nd option.

I use docker-compose in the CI environment (Jenkins), and I run tests with run off command, then use docker cp to get tests results from container and then clean after yourself with docker-compose stop and docker-compose rm. However, it doesn't remove run off container, so I need additional command.

Even I'd use volumes to get test results immediately on host machine, docker-compose run --rm doesn't clean volumes after itself (as far as I know)

@dnephin
Copy link
Author

dnephin commented Mar 24, 2016

This was done in #3178

@dnephin dnephin closed this as completed Mar 24, 2016
@dnephin dnephin added this to the 1.7.0 milestone Mar 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants