From: zimoun <zimon.toutoune@gmail.com>
To: TJ <tj@sheer.tj>, help-guix@gnu.org
Subject: Re: Docker image sizes
Date: Tue, 17 Aug 2021 15:19:36 +0200 [thread overview]
Message-ID: <86wnokb447.fsf@gmail.com> (raw)
In-Reply-To: <87sg0dzfza.fsf@sheer.tj>
Hi,
On Fri, 16 Jul 2021 at 22:06, TJ <tj@sheer.tj> wrote:
> I was trying to package a project in docker and to start I did a fairly
> straightforward command:
>
> $ guix pack --format=docker elixir
>
> It generated an image quite a bit larger than I expected.
>
> -r--r--r-- 2 root root 461M Dec 31 1969 gfnqg760z22vr8kbvyzdzhs1hc5766c9-elixir-docker-pack.tar.gz
I agree the size is an issue.
> After uncompressing, this is taking 1.5GB and is including quite a few
> unnecessary packages for a minimal image - see below for the top 30.
>
> $ du -s * |sort -g -r | head -n 30
> 155804 g3idjpqsp2p2d163qfzskxj4k58nrx7f-llvm-11.0.0
> 145164 m59c9hj9d4n65maimbpmx2xq56d2mvqs-mesa-20.2.4
> 111708 q233v022vziq8ry18y8q959k110vclvf-webkitgtk-2.32.1
> 110840 cgqj7xswlpvhzxwri3mcqfs1fhbgnka8-erlang-23.2.1
> 103940 qk5v5vzwfl066zch67nxlv4x7aspf0fx-samba-4.13.4
> 93972 cw8brvxkzp4kmdqldsv1wkvi2cv4kq4x-python-3.8.2
> 64620 8zvc5mvk0xm3ygrxsgpyy5ilxb5rzjry-perl-5.30.2
> 56300 18hp7flyb3yid3yp49i6qcdq0sbi5l1n-guile-3.0.2
> 52748 nscar35x261xky08qih2ddxq1b105qwd-gtk+-3.24.24
> 41092 fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31
> 39544 2wqjj3mkqdvsvksndr2hpjpi7qqwi7kr-icu4c-66.1
> 35848 fi1mdh30b5q6zvplvayn68lb575xcd1k-ghostscript-with-cups-9.52
> 34768 01b4w3m6mp55y531kyi1g8shh722kwqm-gcc-7.5.0-lib
> 34188 wjmydimw608k61qxmsifkam11jwgpric-wxwidgets-3.0.5.1
> 24224 jv6v8p8jbjf6hpscgp3dgdfylrdhldi1-gdk-pixbuf+svg-2.40.0
> 18488 n8awazyldv9hbzb7pjcw76hiifmvrpvd-coreutils-8.32
> 18464 57xj5gcy1jbl9ai2lnrqnpr0dald9i65-coreutils-8.32
> 16596 jsqxxnaj5p8a22mrsvl679gi7jl26z4j-glib-2.62.6
> 16400 aza259fsrb841zwb4rjzfzs2nrsf28f1-eudev-3.2.9
> 16060 9z185s19zp2p9yq8gdayxgibaphxfcps-cups-2.3.3
> 15604 4l2il4wcxjb443xwc2arwixpq28pbfvl-cups-minimal-2.3.3
> 14140 02z5vgdhgxw4gcjvhx51mvy1ax4lzxmp-fftwf-3.3.8
> 13912 zzkly5rbfvahwqgcs7crz0ilpi7x5g5p-ncurses-6.2
> 13096 lv92cmzqjpb8mxygpqdvh0mkkkfi9vmz-libxcb-1.14
> 10876 n3pjsbpd51x6vqikfglmrdbijflammf6-gst-plugins-base-1.18.2
> 10588 sayvymkqjl328rsivzlp9r46337rvdmz-pulseaudio-14.0
> 10084 7y3lvk3xf4im8n44337mc6y0ccysvfia-font-dejavu-2.37
> 9888 hr1p9l1waam8lk2csdwbzaipf14h9n33-gstreamer-1.18.2
> 9576 a45p39mgqvfd8kjwibyr0q42k1mw7gmf-util-linux-2.35.1-lib
> 8812 z3vbqvpgcz7lag9qci074hjry4j3120i-shared-mime-info-1.15
>
> I wouldn't expect to need llvm, mesa, webkit, samba, python, perl,
> gtk, cups, pulseaudio, etc, etc. in a production image.
You can use the option ’--path’ to find out why elixir depends on
unexpected packages, for instance:
$ guix graph --path elixir samba
elixir@1.12.0
erlang@24.0.2
wxwidgets@3.0.5.1
webkitgtk@2.32.3
libsoup@2.72.0
samba@4.13.1
> What would be the recommended way to minimize the derivation?
Examine each and try to spot what could be cut. For instance, ’erlang’
depends on ’wxwidgets’ which brings a lot of stuff.
Hope that helps,
simon
prev parent reply other threads:[~2021-08-17 18:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-17 5:06 Docker image sizes TJ
2021-07-17 14:10 ` Edouard Klein
2021-07-19 7:10 ` TJ
2021-07-17 15:53 ` Akib Azmain Turja
2021-08-17 13:19 ` zimoun [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86wnokb447.fsf@gmail.com \
--to=zimon.toutoune@gmail.com \
--cc=help-guix@gnu.org \
--cc=tj@sheer.tj \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).