I would like to create a named volume for one of my containers.
This container will need a lot more storage than other containers I run, so I would like to store that particular volume on a different disk that has lots of free space.
I still want the other volumes on the default disk, only that one named volume should go on another disk.
I don't want to use a bind mount because it will make backing up and migrating more complicated.
The only option I can think of is to manually move the volume after it is created (while the container is stopped), and create a symlink from its original location in /var/lib/docker/...
to the new location on the other hard drive. This is very manual though, which leads me to think there must be a better way.
What is the recommended way of achieving this?
Use the local volume driver:
docker volume create -d local -o type=none -o o=bind -o device=/host/path volname
(Taken from this github comment)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With