Skip to content

Using run with --rm deletes volumes created with docker volume create #17907

@metasim

Description

@metasim

Bug Report Information

docker version

Client:
 Version:      1.9.0
 API version:  1.21
 Go version:   go1.4.2
 Git commit:   76d6bc9
 Built:        Tue Nov  3 18:00:05 UTC 2015
 OS/Arch:      linux/amd64

Server:
 Version:      1.9.0
 API version:  1.21
 Go version:   go1.4.2
 Git commit:   76d6bc9
 Built:        Tue Nov  3 18:00:05 UTC 2015
 OS/Arch:      linux/amd64

docker info

Containers: 0
Images: 6
Server Version: 1.9.0
Storage Driver: devicemapper
 Pool Name: docker-8:2-3222770360-pool
 Pool Blocksize: 65.54 kB
 Base Device Size: 10.74 GB
 Backing Filesystem: xfs
 Data file: /dev/loop0
 Metadata file: /dev/loop1
 Data Space Used: 545.8 MB
 Data Space Total: 107.4 GB
 Data Space Available: 106.8 GB
 Metadata Space Used: 1.004 MB
 Metadata Space Total: 2.147 GB
 Metadata Space Available: 2.146 GB
 Udev Sync Supported: true
 Deferred Removal Enabled: false
 Deferred Deletion Enabled: false
 Deferred Deleted Device Count: 0
 Data loop file: /var/lib/docker/devicemapper/devicemapper/data
 Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
 Library Version: 1.02.93-RHEL7 (2015-01-28)
Execution Driver: native-0.2
Logging Driver: json-file
Kernel Version: 3.10.0-229.14.1.el7.x86_64
Operating System: CentOS Linux 7 (Core)
CPUs: 8
Total Memory: 23.38 GiB
Name: x.y.z
ID: MMMV:B5GR:6NIY:ODB7:OV7U:BVJE:VPLR:I56P:D34C:CKKG:ECKU:EWSC

uname -a

Linux x.y.z 3.10.0-229.14.1.el7.x86_64 #1 SMP Tue Sep 15 15:05:51 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

Steps to reproduce:

  1. Create a volume with the new volume command:
docker volume create --name hello
> hello
docker volume ls
> DRIVER              VOLUME NAME
> local               hello
  1. Then "mount" it:
docker run --rm -it -v hello:/world busybox sh
/ # touch world/foobar
/ # exit
  1. Then look for volume:
docker volume ls
> DRIVER              VOLUME NAME

This seems dangerous behavior given that volumes are considered the persistent component of the system.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/enhancementEnhancements are not bugs or new features but can improve usability or performance.status/claimedstatus/needs-attentionCalls for a collective discussion during a review session

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions