How to run LXC docker containers on another partition?

My system consists of two sections:

  • The main 5G partition where Ubuntu is installed
  • 100G side section in /mnt/eda , which I would like to use to run Docker containers

I need to run several Docker containers, which will take up to 10 GB of additional disk space after they start. I want them to use the /mnt/eda disk space form, but how do I do this?

Currently, when I import or run a container, it takes up space from my main section. I tried to download the binary and run it from the side section, but the space from the main section was still used up.

I can not connect / mount disks in my containers - they must be completely separated from the host for security.

+6
source share
1 answer

Of course not a problem!

You can:

  • set the partition to /var/lib/docker
  • make a symbolic link; e.g. from /var/lib/docker to /mnt/eda/docker
  • bind-mount, for example. /mnt/eda/docker to /var/lib/docker
+7
source

Source: https://habr.com/ru/post/957093/


All Articles