3 ms·
First, volumes are 100% separated from containers. If you remove a container, the volumes are not removed unless you explicitly told docker to (docker rm -v <c
by cpuguy83 12y ago
First, volumes are 100% separated from containers.
If you remove a container, the volumes are not removed unless you explicitly told docker to (docker rm -v <container>). And even then, it won't remove the volume if other containers are using it.
That said, it is hard to re-use a volume right now if you removed the last container referencing that volume.
The linked PR solves this issue.
You can mount these SSD's on the host and then use bind-mounts (docker run -v /host/path:/container/path) to get those into the container. Or you can add the devices to the containers directly ("docker run --device /dev/sdb", for example), but you'd need privilaged access to actually mount the device.
The referenced PR itself doesn't really make using things like specialized disks any easier, except you can register them with the volumes subsystem and it will track them form you, ie `docker volumes create --path /path/to/data --name my_speedy_disks`.
There was some discussion around being able to deal with devices directly with Docker instead of expecting the admin to handle mounting those devices onto the host so they can be used as volumes. Nothing finalized here.
Here is where that discussion happened: https://botbot.me/freenode/docker-dev/2014-10-21/?msg=23911528&page=5 https://botbot.me/freenode/docker-dev/2014-10-21/?msg=239115...
- vidarh 12y agoI think the "docker volumes create --path ..." solves my use case just fine. Thanks for providing details - that seems quite useful.