Skip Navigation

Does it ever make sense/is it possible to move certain docker volumes to another physical volume, but not all?

I'm hosting a few services using docker. For something like an openstreetmap tileserver, I'd like it to remain on my SSD because high speed improves performance, and the directory is unlikely to grow and fill the drive.

For other services like NextCloud, speed isn't as important as storage size, so I might want it on a larger HDD raid.

I know it's trivial to move the volumes directory to wherever, but can I move some volumes to one directory and some volumes to another?

18 comments
  • You can run docker containers with multiple volumes. e.g. pass something like -v src1:dst1 -v src2:dst2 as arguments to docker run.

    So -- if I understood your question correctly -- yes, you can do that.

  • This is mostly an IOPS dependent answer. Do you have multiple hot services constantly hitting the disk? If so, it can be advantageous to split the heavy hitters across different disk controllers, so in high redundancy situations that means different dedicated pools. If it’s a bunch of services just reading, filesystems like ZFS use caching to almost completely eliminate disk thrashing.

18 comments