Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker images across multiple disks

Tags:

docker

I'm getting going with Docker, and I've found that I can put the main image repository on a different disk (symlink /var/lib/docker to some other location).

However, now I'd like to see if there is a way to split that across multiple disks.

Specifically, I have an old SSD that is blazingly fast to read from, but doesn't have too many writes left until it kicks the can. It would be awesome if I could store the immutable images on here, then have my writeable images on some other location that can handle the writes.

Is this something that is possible? How do you split up the repository?

like image 628
teeks99 Avatar asked Feb 02 '26 14:02

teeks99


1 Answers

Maybe you could do this using the AUFS driver and some trickery such as moving layers to the SSD after initially creating them and pointing symlinks at them - I'm not sure, I never had a proper look at how that storage driver worked.

With devicemapper thinp, btrfs and OverlayFS this isnt possible AFAICT:

  • The Docker dm-thinp and btrfs drivers both build layers one on top of the other using block device snapshot mechanisms. Your best bet here would be to include the SSD in the storage pool and rely on some ability to migrate the r/o snapshots to a specific block device that is part of the pool. Doubt this exists though.
  • The OverlayFS driver stacks layers by hard-linking files in independent directory structures. Hard-links only work within a filesystem.
like image 121
EricM Avatar answered Feb 04 '26 06:02

EricM



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!