I'm running out of space on my docker container so I decided I'll create lvm volume on host, mount it to /mnt/data and pass it to docker using
docker run -v /mnt/data:/mnt -i -t fedora:wrt /bin/bash
But when I do that, my /mnt dir inside container appears empty, if I look at it via host, I can see files. I tried using
docker run -v /etc:/mnt -i -t fedora:wrt /bin/bash
and I can see hosts /etc files in container /mnt. I then tried passing hosts /boot which is normal xfs partition
docker run -v /boot:/mnt -i -t fedora:wrt /bin/bash
and I can see hosts /boot files in container /mnt
Is there a way of passing mounted lvm volume path to docker container?
ps I'm running docker 1.4.1 with --storage-opt dm.metadatadev=/dev/vg/docker_metadata --storage-opt dm.datadev=/dev/vgdocker_data
Thanks for your help
Are you running Docker under Fedora 20 or 21? A recent change to the systemd unit for Docker set MountFlags=private
, which means that any mounts you make on your host after starting the docker daemon will not be visible to docker containers. For details, see:
There is a fixed package available, but it hasn't hit the main repositories yet. You can get it by running:
yum --enablerepo=updates-testing upgrade docker-io
And then:
systemctl daemon-reload
systemctl restart docker
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.