How to run docker LXC containers on another partition? [closed]

非 Y 不嫁゛ 提交于 2019-12-07 03:54:01

问题


My system has two partitions:

  • 5G main partition where Ubuntu is installed
  • 100G side partition at /mnt/eda that I'd like to use for Docker container runs

I need to start multiple Docker containers that will take up >10G additional disk space after they're launched. I want them to use disk space form /mnt/eda, but how do I do that?

Currently, whenever I import or run a container, space from my main partition is taken up. I tried downloading the binary and starting it from the side partition, but space from main partition was still being used up.

I can't attach/mount drives to my containers -- they must be completely separate from the host for security.


回答1:


Sure, no problem!

You can:

  • mount the partition on /var/lib/docker
  • make a symlink; e.g. from /var/lib/docker to /mnt/eda/docker
  • bind-mount e.g. /mnt/eda/docker to /var/lib/docker


来源:https://stackoverflow.com/questions/19697648/how-to-run-docker-lxc-containers-on-another-partition

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!