From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id r5vQKH3w016GcwAA0tVLHw (envelope-from ) for ; Sun, 31 May 2020 17:59:25 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id gJggJH3w015BUQAAbx9fmQ (envelope-from ) for ; Sun, 31 May 2020 17:59:25 +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 4A6DE940058 for ; Sun, 31 May 2020 17:59:25 +0000 (UTC) Received: from localhost ([::1]:57390 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jfSF2-000205-6z for larch@yhetil.org; Sun, 31 May 2020 13:59:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37122) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jfSE7-0001DC-MP for help-guix@gnu.org; Sun, 31 May 2020 13:58:27 -0400 Received: from mail-qk1-x72c.google.com ([2607:f8b0:4864:20::72c]:46332) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jfSE6-0000GM-PX for help-guix@gnu.org; Sun, 31 May 2020 13:58:27 -0400 Received: by mail-qk1-x72c.google.com with SMTP id c12so7024301qkk.13 for ; Sun, 31 May 2020 10:58:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7rLMT8lpbjwdwWQYnlktvVR4sGEUZcpx1f1dfD+6Th0=; b=g9qN15yAvBfw/+xmKgJqH4QVt0dd9+ssAY4Mn9DigD5nIa30MRoiTDQrTuk5pzDgqD 8NxZ0fnPcjuRDro3nWUIlDwwdXfX/oC6XFGzBiJ6QBYQKqyGmK1VsTZOoSVfVVbOxhVc 668y4luN+pcCWeD8N6nu7dCrj0bgnmZkHV36IFKj4CegiBXSLXWxVSWq6sBB217ShHPW iI7Y/qEL9aqNRyGueUBX4j1Uhx8U/WqxWxmCRNwVj4BafswegDRa9bLQjXV9T13CYmRm eeXFQN5uFCT+tVBdCIKLJj59egMGTiur+5BbatK73DaZ4AHR0wpd9F9gGyjdC47hMLxX Vfvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7rLMT8lpbjwdwWQYnlktvVR4sGEUZcpx1f1dfD+6Th0=; b=PNTQnSgGsBgBuNVwm0BRQ/5UfCF6Vs/fIQ7hR3EWVJB47/OiKUSdBJBJE8ry6aH4I/ 8IIG07RieaQel6OhnF+WkNpfhvanJh+6yrvpNZsqEO2O1NLSzY/zwJ+fYlYK4wFjHnsD xxtAT+37P2KHfWXimUbpW3kfPExFLvsetdpLpcYIFlMxTL8KdPwrtuKNwFvjMZ168i7/ Rj2Hhhnzct9N4qpLlukNx1PLKr1d5c5C6iz/E8EbgrPVucSnnKiuDEDIout21g/mxarQ FQE+p5KoYHP0DqbDAPBS4aGUxAs9X4WYf998+ScTO6HOhLsB/LElmt6baq+wT4glby4x nBlg== X-Gm-Message-State: AOAM5331SfQxzYFbdC0/MAqbbTow/M6e8xeTxVZvfLxBMTFb6Y3K5f+k Pq+S243JJF2wflELa2x0i+d1QIzIRRAJ+yeD7JA= X-Google-Smtp-Source: ABdhPJxexrb6DXawGDtl4ajibcydR6jGfasDNO9dppGmwuFLdagm8WOru3P42Q0XOL0qGPy2alrXcujSbv/TiU3vfMQ= X-Received: by 2002:a37:4656:: with SMTP id t83mr16839063qka.126.1590947905533; Sun, 31 May 2020 10:58:25 -0700 (PDT) MIME-Version: 1.0 References: <87h7vyxqrz.fsf@gmail.com> <7a07e6d0-e45d-6c5f-f536-34a065100d8f@gmail.com> In-Reply-To: <7a07e6d0-e45d-6c5f-f536-34a065100d8f@gmail.com> From: zimoun Date: Sun, 31 May 2020 19:58:13 +0200 Message-ID: Subject: Re: Guix Docker image inflation To: Vincent Legoll Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2607:f8b0:4864:20::72c; envelope-from=zimon.toutoune@gmail.com; helo=mail-qk1-x72c.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001 autolearn=_AUTOLEARN 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: 41607@debbugs.gnu.org, help-guix , Stephen Scheck Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=gmail.com header.s=20161025 header.b=g9qN15yA; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=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-Spam-Score: 3.09 X-TUID: Vdux50oVnSQ7 Hi Vincent, On Sun, 31 May 2020 at 12:50, Vincent Legoll wrote: > docker export | docker import - img_name I do not know if it really works here. Maybe I am doing incorrectly... --8<---------------cut here---------------start------------->8--- $ docker images --format "{{.Size}}\t{{.Repository}}" 959MB 4reexport 960MB 3clean 960MB 2remove-hello 959MB 1install-hello 578MB 0new-fresh 1.06GB fresh 1.06GB singularsyntax/guix-bootstrap --8<---------------cut here---------------end--------------->8--- Well, and the interesting part is: --8<---------------cut here---------------start------------->8--- $ CONTAINER=`docker run --detach --tty --privileged 4reexport` $ docker exec --interactive --tty $CONTAINER /bin/sh / # /root/.config/guix/current/bin/guix gc --list-live | grep hello /root/.config/guix/current/bin/guix gc --list-live | grep hello finding garbage collector roots... determining live/dead paths... / # /root/.config/guix/current/bin/guix gc --list-dead | grep hello /root/.config/guix/current/bin/guix gc --list-dead | grep hello finding garbage collector roots... determining live/dead paths... /gnu/store/kg9mirg6xbvzcp0a98v7326n1nvvwgsj-hello-2.10 / # /root/.config/guix/current/bin/guix gc --references /gnu/store/kg9mirg6xbvzcp0a98v7326n1nvvwgsj-hello-2.10 /root/.config/guix/current/bin/guix gc --references /gnu/store/kg9mirg6xbvzcp0a98v7326n1nvvwgsj-he llo-2.10 guix gc: error: path `/gnu/store/kg9mirg6xbvzcp0a98v7326n1nvvwgsj-hello-2.10' is not valid / # exit --8<---------------cut here---------------end--------------->8--- Just for the record, the commands run: --8<---------------cut here---------------start------------->8--- $ CONTAINER=`docker run --detach --tty --privileged fresh` $ CMD='CMD "/root/.config/guix/current/bin/guix-daemon" "--build-users-group=guixbuild"' $ docker export $CONTAINER \ | docker import --change $CMD - 0new-fresh $ CONTAINER=`docker run --detach --tty --privileged 0new-fresh` $ docker exec --interactive --tty $CONTAINER /bin/sh / # /root/.config/guix/current/bin/guix install hello / # exit $ docker stop $CONTAINER $ HASH=`docker commit $CONTAINER` && docker tag $HASH 1install-hello $ CONTAINER=`docker run --detach --tty --privileged 1install-hello` $ docker exec --interactive --tty $CONTAINER /bin/sh / # /root/.config/guix/current/bin/guix remove hello / # exit $ docker stop $CONTAINER $ HASH=`docker commit $CONTAINER` && docker tag $HASH 2remove-hello $ CONTAINER=`docker run --detach --tty --privileged 2remove-hello` $ docker exec --interactive --tty $CONTAINER /bin/sh / # /root/.config/guix/current/bin/guix pull -d / # /root/.config/guix/current/bin/guix package -d / # /root/.config/guix/current/bin/guix gc / # exit $ docker stop $CONTAINER $ HASH=`docker commit $CONTAINER` && docker tag $HASH 3clean $ CONTAINER=`docker run --detach --tty --privileged 3clean` $ docker export $CONTAINER | docker import --change $CMD - 4reexport --8<---------------cut here---------------end--------------->8--- where I cheated with $CMD which does not as is but the full 'CMD...' has to be typed after '--change'. All the best, simon