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

Volumes left orphaned when not all refering containers use -v #14622

Closed
jest opened this issue Jul 14, 2015 · 7 comments
Closed

Volumes left orphaned when not all refering containers use -v #14622

jest opened this issue Jul 14, 2015 · 7 comments
Labels
kind/bug Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed.

Comments

@jest
Copy link

jest commented Jul 14, 2015

The docs say that the volume will be removed when the last referring container uses rm -v. However, this doesn't happen when previously some containers were removed without -v switch:

$ docker create --name d1 -v /data busybox
$ docker create --name c1 --volumes-from d1 busybox
$ VOL=$(docker inspect -f '{{ index .Volumes "/data" }}' d1)
$ ls -d $VOL
/var/lib/docker/volumes/f2cf6f32f91fbf1d9778665c1b20ac09146f1b066c1f4d73746954b1ae66cb03/_data
$ docker rm c1
$ docker rm -v d1
$ sudo ls -d $VOL
/var/lib/docker/volumes/f2cf6f32f91fbf1d9778665c1b20ac09146f1b066c1f4d73746954b1ae66cb03/_data

docker info:

Containers: 3
Images: 61
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 67
 Dirperm1 Supported: true
Execution Driver: native-0.2
Logging Driver: json-file
Kernel Version: 3.19.0-22-generic
Operating System: Ubuntu 14.04.2 LTS
CPUs: 8
Total Memory: 11.46 GiB
Name: pw-tp
ID: ZTDW:FI5G:NERJ:QYQB:6GWU:PTCK:AC7E:YAHH:G4L7:I45P:SLDC:ZLCU
WARNING: No swap limit support
@GordonTheTurtle
Copy link

Hi!

Please read this important information about creating issues.

If you are reporting a new issue, make sure that we do not have any duplicates already open. You can ensure this by searching the issue list for this repository. If there is a duplicate, please close your issue and add a comment to the existing issue instead.

If you suspect your issue is a bug, please edit your issue description to include the BUG REPORT INFORMATION shown below. If you fail to provide this information within 7 days, we cannot debug your issue and will close it. We will, however, reopen it if you later provide the information.

This is an automated, informational response.

Thank you.

For more information about reporting issues, see https://github.com/docker/docker/blob/master/CONTRIBUTING.md#reporting-other-issues


BUG REPORT INFORMATION

Use the commands below to provide key information from your environment:

docker version:
docker info:
uname -a:

Provide additional environment details (AWS, VirtualBox, physical, etc.):

List the steps to reproduce the issue:
1.
2.
3.

Describe the results you received:

Describe the results you expected:

Provide additional info you think is important:

----------END REPORT ---------

#ENEEDMOREINFO

@jest
Copy link
Author

jest commented Jul 14, 2015

docker version:

Client version: 1.7.0
Client API version: 1.19
Go version (client): go1.4.2
Git commit (client): 0baf609
OS/Arch (client): linux/amd64
Server version: 1.7.0
Server API version: 1.19
Go version (server): go1.4.2
Git commit (server): 0baf609
OS/Arch (server): linux/amd64

uname -a:

Linux pw-tp 3.19.0-22-generic #22~14.04.1-Ubuntu SMP Wed Jun 17 10:03:13 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

@cpuguy83 cpuguy83 added the kind/bug Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed. label Jul 14, 2015
@cpuguy83
Copy link
Member

Hi thanks for reporting.
This is a known issue with how volumes are accounted in Docker 1.7 and is fixed as part of #14242

@jest
Copy link
Author

jest commented Jul 14, 2015

OK, thanks.

Out of curiosity, where is the "flag" present that keeps the volume not deleted even when the last container is removed with -v? Obviously not in containers; volumes also look ephemeral to me. Some internal bookkeeping?

@cpuguy83
Copy link
Member

@jest Yes, in volume/local. Volumes are only incremented on Create and decremented on Remove. However Remove is only ever called if someone passed in -v to rm.

Restarting the daemon would resolve this issue for you, since this is all kept in memory only.

@jest
Copy link
Author

jest commented Jul 14, 2015

OK, I see. So restarting the daemon before the last rm -v is a workaround.

@cpuguy83
Copy link
Member

Closing as this is now fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed.
Projects
None yet
Development

No branches or pull requests

3 participants