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

docker-sync clean can't delete volume if they are still in use. #73

Closed
gagarine opened this issue Jul 31, 2016 · 3 comments
Closed

docker-sync clean can't delete volume if they are still in use. #73

gagarine opened this issue Jul 31, 2016 · 3 comments

Comments

@gagarine
Copy link

If the docker-sync's volume are still attached to a containers (even stooped), it will not remove those volume:

➜  git:(dev) ✗ docker-sync clean
Error response from daemon: No such container: code-sync
Error response from daemon: No such container: code-sync
Error response from daemon: Unable to remove volume, volume still in use: remove code-sync:
volume is in use - [0bf8bf2d470b484fd736cd245134bf75e294bd5eb664625688f649a57d54533c,
a266be7316732935631a3abc834cdf58e438385ff8fd6f201237a23a19a18109]
  success  Finished cleanup. Removed stopped, removed sync container and removed there volumes

I guess this is a safeguard, but what are the use cases as you should still have your files on your local file system.

Perhaps we can add a --force flag. Or a confirmation dialogue can be the default behavior:

➜  git:(dev) ✗ docker-sync clean --force
Volume still in use - [0bf8bf2d470b484fd736cd245134bf75e294bd5eb664625688f649a57d54533c,
a266be7316732935631a3abc834cdf58e438385ff8fd6f201237a23a19a18109]

Are you sure you want to delete those volume (y/n): 
@gagarine gagarine changed the title Docker-sync can't cleanup if volume are in use. docker-sync clean can't delete volume if they are still in use. Jul 31, 2016
@EugenMayer
Copy link
Owner

this is not a docker-sync issue, its how docker works. You cannot delete volumes if contaieners are running using them, thats just not possibe - can implement this

@gagarine
Copy link
Author

gagarine commented Aug 1, 2016

Ok. Thanks for your reply.

@baohx2000
Copy link

Just as a hint for others who run into this, even if the container is no longer running, it might still be linked to the volume, so you will have to docker rm {container} on all of the ones linked. You can then safely docker-sync clean and start everything up again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants