Docker: Mounting block devices into container

Today was curious is it possible to mount block device into a docker container without mounting it on system. It’s not well documented but found one interesting comment in github. So, if –mount option in docker run command is “magic” on top of “mount” system call, we can use it. After experimenting a bit here is an example mounting lvm volumes. First, let’s create loop device for LVM: dd if=/dev/zero of=/tmp/loop bs=1M count=100 losetup /dev/loop0 /tmp/loop Then, making an LVM device:...

July 25, 2019

Docker: Using docker with LVM Thin Pool

Docker is the nice tool for almost every use case in my sphere. It’s easy to use, it’s fast to build and deploy. Docker can be used with miscellaneous storage drivers such as btrfs, datamapper, overlayfs, aufs. A long time I was using docker with btrfs backend and everything seems to be nice, but when load on this server increased, corrupted layers are began to appear. It looks like build process in the next RUN step unable to find files from previous step....

February 8, 2016