[Lxc-users] lxc-ubuntu: lefotover cached package files
Fajar A. Nugraha
list at fajar.net
Thu Aug 16 15:42:11 UTC 2012
On Thu, Aug 16, 2012 at 8:57 PM, Serge Hallyn
<serge.hallyn at canonical.com> wrote:
> Quoting Fajar A. Nugraha (list at fajar.net):
>> Creating a container with "lxc-create -t ubuntu" on ubuntu 12.04 amd64
>> currently results in over 300MB root filesystem. However, almost
>> 100MBs of it are cached package files (/var/cache/apt/archives/*).
>> Running "apt-get clean" freed it.
>>
>> Is there a particular reason to keep the package files after container creation?
>
> Hm. Well I personally actually do end up using those often - I create a
> container; quickly build a new version of a package; do a test; re-install
> from /var/cache/apt/archives to do another test; etc.
>
> But that's not to say mine shouldn't be a special case, with the default
> being to save space.
Yup. Special cases like that can be catered using a private proxy or
something similar.
> Do you mind opening a bug against the ubuntu package
> for that? (http://pad.lv/u/lxc) I've got another small template fix to
> push anyway. (I'll post the patch to lxc-devel when done.)
>
> Thanks for the suggestion.
Done.
FWIW, for those interested in having the smallest ubuntu container, my
test result is:
- original lxc-ubuntu: 386M disk space used
- apt-get clean: reduced to 242M
- install and use localepurge, keeping en and en_US only: reduced to 233M
- change debootstrap command to include "--variant=minbase" while
adding "iputils-ping,isc-dhcp-client,sudo" to list of packages,
followed the above three: reduced to 216M
IMHO space reduction from the last two doesn't warrant the additional
hassle, so the bug report only suggests running "apt-get clean" like
my original mail.
Using a backstore with gzip compression (e.g. btrfs, zfs) also
provides good space saving.
--
Fajar
More information about the lxc-users
mailing list