Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide isar-image-tiny #24

Open
jan-kiszka opened this issue Jul 19, 2017 · 9 comments
Open

Provide isar-image-tiny #24

jan-kiszka opened this issue Jul 19, 2017 · 9 comments

Comments

@jan-kiszka
Copy link
Contributor

The docker image debian:stretch-slim is only 55 MB on x86 (granted, without kernel and modules), isar-image-base rootfs is 540 MB. It should be possible to provide a similarly slim image via Isar as well.

@ismagulb
Copy link
Contributor

Indeed, the kernel takes 136 MB, df -h on qemuamd64-stretch reports 540 MB. So, 136 + 55 = 191 MB might in theory be achievable. We have to look what docker installs. What is the use case?

qemuamd64-stretch has:
104 packages
25 essential
54 required
21 important
5 standard
21 optional
3 extra

FWIW, an attempt to remove the extra libapparmor1 and liblz4-1 fails, since packages like dbus, systemd, etc. depend on those.

@jan-kiszka
Copy link
Contributor Author

The use case is simply having a small working baseline for projects to derive from, rather than a larger base image to be shrunk when size matters (due to limited storage - or limited bandwidth when downloading update).

@ismagulb
Copy link
Contributor

Hmm, to my knowledge, it already is -- we don't add extra packages. So, less is going to be stripping below the minimal installation calculated by multistrap. Let us check what docker installs and whether it's possible to install less with multistrap, or whether we'd have to remove packages in post-processing. If it's doable, it should become the base image.

@jan-kiszka
Copy link
Contributor Author

Here is the list of stretch-slim:

adduser
apt
base-files
base-passwd
bash
bsdutils
coreutils
dash
debconf
debian-archive-keyring
debianutils
diffutils
dpkg
e2fslibs:amd64
e2fsprogs
findutils
gcc-6-base:amd64
gpgv
grep
gzip
hostname
init-system-helpers
libacl1:amd64
libapt-pkg5.0:amd64
libattr1:amd64
libaudit-common
libaudit1:amd64
libblkid1:amd64
libbz2-1.0:amd64
libc-bin
libc6:amd64
libcap-ng0:amd64
libcomerr2:amd64
libdb5.3:amd64
libdebconfclient0:amd64
libfdisk1:amd64
libgcc1:amd64
libgcrypt20:amd64
libgpg-error0:amd64
liblz4-1:amd64
liblzma5:amd64
libmount1:amd64
libncursesw5:amd64
libpam-modules:amd64
libpam-modules-bin
libpam-runtime
libpam0g:amd64
libpcre3:amd64
libselinux1:amd64
libsemanage-common
libsemanage1:amd64
libsepol1:amd64
libsmartcols1:amd64
libss2:amd64
libstdc++6:amd64
libsystemd0:amd64
libtinfo5:amd64
libudev1:amd64
libustr-1.0-1:amd64
libuuid1:amd64
login
lsb-base
mawk
mount
multiarch-support
ncurses-base
ncurses-bin
passwd
perl-base
sed
sensible-utils
sysvinit-utils
tar
tzdata
util-linux
zlib1g:amd64

@elfgoh
Copy link

elfgoh commented Oct 19, 2017

Based on the image I built and running df command, the space used is 340M, which seems a little big for a base image. Please consider slimming it down :)

@stormc
Copy link
Contributor

stormc commented Nov 7, 2017

One target may be /usr/share/locale which accounts for 30,9 MiB.
Another worthwhile target may be /var/cache/apt/archives which accounts for ~118 MiB and only contains packages that are already installed, i.e., "waste".

@jan-kiszka
Copy link
Contributor Author

jan-kiszka commented Nov 7, 2017

Final apt-get clean missing? We also have rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* in our Dockerfile. /usr/share/local requires analysis which packages are filling it up.

@stormc
Copy link
Contributor

stormc commented Nov 8, 2017

It's the unused locale in /usr/share/locale, so a final localepurge should solve this as /etc/locale.nopurge is setup.

@stormc
Copy link
Contributor

stormc commented Nov 10, 2017

With commit ec997ad, waste induced by the apt cache and superfluous locales is fixed.

For "tiny" images, I'd like to see

  • @jan-kiszka's rm -rf /var/lib/apt/lists/* accounting for 63MiB,
  • some strip-down of /lib/modules which accounts for 181MiB,
  • (optional?) removal of docs, e.g., /usr/share/{man,doc} which accounts for ~ 15MiB, and
  • (optional?) cleanup of i18n and timezones /usr/share/{i18n,zoneinfo} accounting for ~17MiB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants