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