From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id ePkuHnzT02T44wAASxT56A (envelope-from ) for ; Wed, 09 Aug 2023 19:57:16 +0200 Received: from aspmx1.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id AD/9HXzT02RVHQAAauVa8A (envelope-from ) for ; Wed, 09 Aug 2023 19:57:16 +0200 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 020C73D013 for ; Wed, 9 Aug 2023 19:57:16 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=polaris64.net header.s=MBO0001 header.b=tIcdkM5d; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1691603836; a=rsa-sha256; cv=none; b=Tb8lg1z5VipMbxWVKnxLgukLhNs8mQm8I0DH3eyOYhRmvxT3GNoWvPZyMiu9cF7bbqUOyN uqM0OfY6nHqL1Uu4RnCUMgF+mTNMoaVJ/kahdYCBSdZCtdeyOo+8UQ5SXqrLQ/QJp9lDZC 8rjgXJY+COdM1uqgDSRaxvTFU0KfjZmmE3MVKyCgyCf4wiZpWM9+8qiYRKOI5q2xPiwjju y3Xs5B8Gmqs+DEqsNg/sufXHpN0q87wgR1v7AgPDVENhpIXy4axrLi/E4D7pt6LPb6jQeY uyhjtbcvqa46CIRWpty6j9D1ja3InB4LAeljfxVQgGmDUkRX3AwH2Xbn189Xng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1691603836; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=CHwPsR1SB48Hh3++ki5L59ve6OAEEjkT1HkW6zq821Y=; b=glulf1fyb1wnUtqUQIEx41JNHkIATtRka1esHvJeczlFOU1pSn3gKMNDAiaTJGwJIGlBBX gCOw+Lw2EfAWuBN4GTT4/lTOfemyAclGq20WP1h+5v0uZQsJxZq49lOGA9ejwPr+8rlM+9 DPedd4Wqm58fLl10Cu+luX2SWCI5LO4D0/Pqw3m854SJXHOj0nHfMgvl2vS8oApNgFoLMI UQvWhB5g4cCHfQO3VF39E59h74BYxhp3lOX0sLySkXeM7Kb2jctOp33NgpQ1OrKD4qFpDH 2rjMl0E/Canib/R+x8q4CF53dc1JXk2gJowC/WpO/md1saYduRFz3JvKvEcceQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=polaris64.net header.s=MBO0001 header.b=tIcdkM5d; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=none Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qTnQY-0005N3-K0; Wed, 09 Aug 2023 13:56:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qTjKn-0002IB-Pw for help-guix@gnu.org; Wed, 09 Aug 2023 09:34:45 -0400 Received: from mout-p-202.mailbox.org ([2001:67c:2050:0:465::202]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1qTjKl-0001TW-6p for help-guix@gnu.org; Wed, 09 Aug 2023 09:34:45 -0400 Received: from smtp202.mailbox.org (smtp202.mailbox.org [IPv6:2001:67c:2050:b231:465::202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4RLWHt0XsRz9tnN for ; Wed, 9 Aug 2023 15:34:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polaris64.net; s=MBO0001; t=1691588074; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=CHwPsR1SB48Hh3++ki5L59ve6OAEEjkT1HkW6zq821Y=; b=tIcdkM5dF4VQNAIE0kHQ+kNGf+Ai55/m9DoV9oMwKqwcKbwSmICRqXA7jsXZQsDvtjRcYX TeQ2QrY8cphSe+j1bxENyUbTZR8vAQ2y6ZDWy6xL2QjA2eroLYnTekprCxzy/hFhzEyJh0 giS1GCa9gkl+RiqugzfySyzwrmU6JnzWnIwuhW58R8CdfZ7yVmwoMISUEPCcNdleVmEdWp PDLvGdaT0N+wopEChfw75i6Vm7di2Z+W6cLCBk7LzzXTL0kcEJJUeNY49uu+6mvc+3KeF5 r/IJMbVls7DgkIfVOSx+j6CLAsFOv8cEHK21S2HTAaSuxSvxpxZTNHCOWNpp/Q== From: Simon Pugnet To: help-guix@gnu.org Subject: guix pack: support for something similar to Nix's buildLayeredImage Date: Wed, 09 Aug 2023 13:59:02 +0100 Message-ID: <871qgcwd93.fsf@polaris64.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Rspamd-Queue-Id: 4RLWHt0XsRz9tnN Received-SPF: pass client-ip=2001:67c:2050:0:465::202; envelope-from=simon@polaris64.net; helo=mout-p-202.mailbox.org X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Wed, 09 Aug 2023 13:56:57 -0400 X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: help-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -9.16 X-Migadu-Scanner: mx2.migadu.com X-Migadu-Queue-Id: 020C73D013 X-Spam-Score: -9.16 X-TUID: 5Cb3a9GLzUlF --=-=-= Content-Type: text/plain; format=flowed Hi, I have been experimenting with using guix pack to build images. Take the following examples: - 1. guix pack -f docker coreutils 2. guix pack -f docker python 3. guix pack -f docker coreutils python 4. guix pack -f docker rust 5. guix pack -f docker coreutils rust If I then import those three (via "docker load < (store path to pack)") I see the following Docker images: - 1. coreutils latest 0ea7b529fa11 53 years ago 99.3MB 2. python latest b6ff62311ffe 53 years ago 234MB 3. coreutils-python latest 17b7d53c54f1 53 years ago 255MB 4. rust latest 71c34a198b4a 53 years ago 1.05GB 5. coreutils-rust latest 96398a0a9efd 53 years ago 1.07GB Inspecting those images shows that they each have only a single layer: - 1. "Layers": ["sha256:0a82bb2a1af9a9e0f5c9ee48c0d103890bf520cf5fceb82be16d14f38f76c351"] 2. "Layers": ["sha256:bdf366b7105cddb8c0fecded8a41f9d34389b2d19cb7c5e0b7760bd550f83d3a"] 3. "Layers": ["sha256:361dae9e271d6ab0195ef3f8f338e03ec5114097e373197b73986ebc6bdf6cf1"] 4. "Layers": ["sha256:64cb9e95374bdcd92034ad4956160ba4855f6e092b43a77ec38e1f8c5e4caad5"] 5. "Layers": ["sha256:6c41ed1574777cd49d25e48d78d4e9070d9549c5c263f9f708af2c7e9f05f357"] Examining the image storage directories for each shows them to have the following sizes (in bytes): - 1. 99349355 2. 234345507 3. 255198424 (~20MB larger) 4. 1046735591 5. 1067588316 (~20MB larger) The problem with this is that for example the coreutils-python image contains coreutils as does any other image that happens to use coreutils like the example coreutils-rust. Examining the actual coreutils directory size in each image (/gnu/store/yr39rh6wihd1wv6gzf7w4w687dwzf3vb-coreutils-9.1) shows that it's 17131414 bytes in size, which corresponds approximately to the size increase I'm seeing in coreutils-python and coreutils-rust. I'm not a Guix or Nix expert but as far as I understand Nix solves this problem by using "pkgs.dockerTools.buildLayeredImage" (see http://ryantm.github.io/nixpkgs/builders/images/dockertools/#ssec-pkgs-dockerTools-buildLayeredImage) and "streamLayeredImage". In this example, this could in theory be used to build a coreutils-python image where coreutils exists in its own layer. That would mean that the coreutils-rust image could share the coreutils layer, saving space. Is there any way to achieve something similar in Guix? If not then are there any plans to support this functionality? Kind regards, -- Simon Pugnet https://www.polaris64.net/ PGP key fingerprint: 3BF7 85DE 162C 00C8 FB4D A6FD BA13 59A8 2C0B 3EF9 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJIBAEBCAAyFiEEO/eF3hYsAMj7Tab9uhNZqCwLPvkFAmTTlegUHHNpbW9uQHBv bGFyaXM2NC5uZXQACgkQuhNZqCwLPvk2bxAAi3Uagf5gWFlqsEnNwjzDTmi2BEWu JKP0+tnWeFuP115+DxBwJ1R2lKC1UcuihtFdgilY6we7jxLyF1154EzGhV9JeMqV FvUpTtcysf8KVakgIDf9vDxy+SYEO+/zHRRhQvYGQ3GPfAtkoQq+h7dz8CAbCq52 ntHk09XVk44OfwgAsOQN8rOvZwM6P76IxtRchSDDaRYnpB+Tzu+3gG7paITC4sZ/ VGahV0iN8jPFBcLC1cWgETiUCkdX2d1cRaL2BK2HTj5mRFLU/oTE658GGU0cJ7cq dmZ3r1cWz0Q74NVfGbQuNlHOVuQPjQ6ZNswzsQ6GMc/piyX/hKaeU1et1y1b8vwU 50Zdm+p7+eiCT2GIxUTB23PM+FhPhlUY6hkJTYwAA1+A7o3AxAVXA22WO0iMCNBi +ONjs5/e9raS49Yv9AGPuUH/uWTTKCHSL6t7krK2xhDk2/kDzM1BJVWRrrB0jljv S/I+RP6EcWnK1o4YEXzFRtTMSXeq2aMnlcrOQFC7Tr1R8GZj3e5Nmqm4fw5mNVLJ 0yCoNZKcSGwaU62zTQ02qrN2qfBdRsPWMONo21MWbzV8Nq+Q/yOifkTIA0dys6yF ld52lZdroO3fb/qakkMe1wCwaPcRoj2MkPxeEZEVp8ysnCwJqFd7GW5JcgAsZno5 PxE1OJJLwwM/sx8= =K/kJ -----END PGP SIGNATURE----- --=-=-=--