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:...