lxc-create wastes disk space by keeping installation debs
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lxc (Ubuntu) |
Fix Released
|
Medium
|
Unassigned |
Bug Description
A default ubuntu container created using "lxc-create -n ubuntu -t ubuntu" results in 386M space used on /var/lib/
The wasted space becomes even more apparent if the backing store supports compression (e.g. zfsonlinux with gzip compression enabled). In this case the original used space (after compression) was 196M, and was reduced to 95M after the cached package files are removed, over 50% disk space saving.
Suggestion: Modify lxc-ubuntu template to run "apt-get clean" inside the container's rootfs as part of container creation process.
# lsb_release -rd
Description: Ubuntu 12.04.1 LTS
Release: 12.04
# apt-cache policy lxc
lxc:
Installed: 0.7.5-3ubuntu62
Candidate: 0.7.5-3ubuntu62
Version table:
*** 0.7.5-3ubuntu62 0
500 http://
100 /var/lib/
0.
500 http://
Expected result:
"lxc-create -t ubuntu" result in a container which uses disk space efficiently
Actual result:
"lxc-create -t ubuntu" result in a container which uses more disk space than it should
Thanks, Fajar. Agreed this should be done.