From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id KLJtFwnl8mCyaQAAgWs5BA (envelope-from ) for ; Sat, 17 Jul 2021 16:11:21 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id oPs3Ewnl8mAHJgAAbx9fmQ (envelope-from ) for ; Sat, 17 Jul 2021 14:11:21 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id D9D3E1B717 for ; Sat, 17 Jul 2021 16:11:20 +0200 (CEST) Received: from localhost ([::1]:43222 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m4l2E-0003k6-Pt for larch@yhetil.org; Sat, 17 Jul 2021 10:11:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33768) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m4l20-0003eU-KK for help-guix@gnu.org; Sat, 17 Jul 2021 10:11:04 -0400 Received: from sender4-op-o11.zoho.com ([136.143.188.11]:17178) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m4l1y-0007zT-6b for help-guix@gnu.org; Sat, 17 Jul 2021 10:11:04 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1626531057; cv=none; d=zohomail.com; s=zohoarc; b=aZnodl9qp7bx4oJUVwY8ylJ0Q3Zg4Xmq3manBIvWQoK7kA040L4heIwTCGMadteZieINvF4kngX3ewbJeCmakJrKQ6mQEvKnui25RMXplIsCxyy/VkqDc3HE8G7/JfN0cAm3RMabfoW83TbOzDH0dEztyPIXXS0nTv2AmPG4Be0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1626531057; h=Content-Type:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=tznj/vPIhKYDx6QP0Upzx1iuGvDIv0WrdJPT4VskTNU=; b=LHAtTdqgpLVOBqlQimDklxD5FfVjmG1BQrYC02/13xwylP8SfOC5wuQqK/Btc4ka7YQcVbHgnn8VaavA0NIyMnDs2lqMRCZmm5I9fSMbdvDj2X+48+IZ/LSWCIxIdFJWhD7gHdCWVaYnvxHZB3Wit6fd2ACFerQKZLCumWH1e1M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=rdklein.fr; spf=pass smtp.mailfrom=edou@rdklein.fr; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1626531057; s=zoho; d=rdklein.fr; i=edou@rdklein.fr; h=References:From:To:Cc:Subject:In-reply-to:Message-ID:Date:MIME-Version:Content-Type; bh=tznj/vPIhKYDx6QP0Upzx1iuGvDIv0WrdJPT4VskTNU=; b=Bni4Z8DFDPL+10w2j183N3CmIMCGqtZ/QKDts2g29W41+W0pmTQPtaPsECBLgwIm 3OCnJUgYNe/dMIBY7YvIsL/37WYQg5Pp/0LWf+FrMp5OpB+5GKNJvULGhXq6jvZiVkA UGpFrhHjKnNZcq9cepGj7Izi6bIHRUIsVWh1QiS0= Received: from Rasoir (186.40.205.77.rev.sfr.net [77.205.40.186]) by mx.zohomail.com with SMTPS id 1626531053679596.8824802545836; Sat, 17 Jul 2021 07:10:53 -0700 (PDT) References: <87sg0dzfza.fsf@sheer.tj> User-agent: mu4e 1.4.15; emacs 27.2 From: Edouard Klein To: TJ Subject: Re: Docker image sizes In-reply-to: <87sg0dzfza.fsf@sheer.tj> Message-ID: <87eebxf2u8.fsf@rdklein.fr> Date: Sat, 17 Jul 2021 16:10:39 +0200 MIME-Version: 1.0 Content-Type: text/plain X-ZohoMailClient: External Received-SPF: pass client-ip=136.143.188.11; envelope-from=edou@rdklein.fr; helo=sender4-op-o11.zoho.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: help-guix@gnu.org Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1626531081; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=tznj/vPIhKYDx6QP0Upzx1iuGvDIv0WrdJPT4VskTNU=; b=qar2/PWYbGbfAMaLs350Lxo/jwfGj4n9h96MQvCaTPjdGaa84ybo6F8/bhAJEmMmHV1xT/ q6cxBD1WwzNB1VSpFxaxXcFWVPgM1Q0x5VBpTSgtAgcBpVsdPFEPqGtF9tNme8mJRf/Rg+ BKZj5I4riL4pSaRr4pU9xH8mt9J7jtB4RzA3EzTM2k1JIpAEFlPmiJrQdcv8Two3iNCnHV 6oZog7PiVOHoQGIZKNQofEGS2x0OrnHWkgSiLr3pg7ePAVruyHAERZEssdjeKHjWrMPKb9 Ioqy/pJeCI3WyIZWVPxdvxfssJKYZsujZH3BeO02eqMJgt0jX1dSSNxBnl1IKA== ARC-Seal: i=2; s=key1; d=yhetil.org; t=1626531081; a=rsa-sha256; cv=pass; b=aTALKlrwpPN/VSDqpoiHpVh5gCvq84UeOGLlsmdikQd6SlCnelkVp7zq7awR7R0RXjqKxE vtXO+W1b59OJY6m7T4y3WeNCf1tkZghB+sYIJ6JT6BMvgn4rX9Fi3z+Oi7b0SEVLgh0bwf 23P3K8KQEVUHUy2U7/85aRN4sJ80XPXqFJbTMvuH2fYMrHpCZkW0KR6W+edN9Cf26f0T+W O7dKIgxQg8YLTrdiht6x7X1iZe7KV2EfD3/UNw/LDWy3rGsYklt9Cux220ra71BYYTjzc2 VjlanwUkt4ac1vx2ulGP3KUgxV1WiDtMjPMX7CoKmnbz3oDJZ/ZKU4UtYyUFPQ== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=none ("invalid DKIM record") header.d=rdklein.fr header.s=zoho header.b=Bni4Z8DF; arc=pass ("zohomail.com:s=zohoarc:i=1"); dmarc=none; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Migadu-Spam-Score: -3.41 Authentication-Results: aspmx1.migadu.com; dkim=none ("invalid DKIM record") header.d=rdklein.fr header.s=zoho header.b=Bni4Z8DF; arc=pass ("zohomail.com:s=zohoarc:i=1"); dmarc=none; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Migadu-Queue-Id: D9D3E1B717 X-Spam-Score: -3.41 X-Migadu-Scanner: scn0.migadu.com X-TUID: Iz0aB92x4oGA Hi ! You can use guix graph to see what depends on what, and find out why a specific dependency is needed: https://guix.gnu.org/manual/en/html_node/Invoking-guix-graph.html I just invoked: guix graph elixir > /tmp/toto.dot and by manually inspecting the dot file I can see that e.g. webkit is needed by wxWidgets, whether you need those or not is up to you. You can generate the visual graph with dot -T pdf < /tmp/toto.dot > /tmp/toto.pdf I'm looking at it right now, and I see that elixir depends on erlang and git, and that git is pulling perl with it. I doubt that's needed, so maybe you can create a new package "lean-elixir", and forego the dependency on git somehow ? If you cut a branch early in the DAG you may get huge returns on investment, size-wise. This may not be the best approach, maybe some wizards here will have better ideas. Cheers, Edouard. TJ writes: > Hi, > > 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 > > 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. > > What would be the recommended way to minimize the derivation? > > Thanks, > > TJ