unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: zimoun <zimon.toutoune@gmail.com>
To: Stephen Scheck <singularsyntax@gmail.com>, 41607@debbugs.gnu.org
Cc: help-guix <help-guix@gnu.org>
Subject: Re: Guix Docker image inflation
Date: Sun, 31 May 2020 10:24:25 +0200	[thread overview]
Message-ID: <CAJ3okZ2PjxUPjdt4tChB=MRT2EvPb69QBOEXut1RSn3SGhU_3A@mail.gmail.com> (raw)
In-Reply-To: <CAKjnHz1=4v5kMQ8G6+_rQpMrK183HD5JUW8YKuvFPVX-e_UfWw@mail.gmail.com>

Dear Stephen,

Follow ups of
https://lists.gnu.org/archive/html/help-guix/2020-05/msg00249.html
and bug#41607 CC http://issues.guix.gnu.org/41607


On Sat, 30 May 2020 at 19:02, Stephen Scheck <singularsyntax@gmail.com> wrote:

> You can convince yourself of this by doing something like the following:
>
>     docker run <some-linux-image>
>     docker exec <container-id> dd if=/dev/urandom of=/RANDOM-DATA
> bs=1048576 count=1024
>     docker commit <container-id>
>     docker exec <container-id> rm /RANDOM-DATA
>     docker commit <container-id>

It does not convince myself and maybe I am doing wrongly but it is not
what I am observing for an example with more than 2 'commits'.  Here
my session, based on your images rename "fresh" because it will happen
on any image.

--8<---------------cut here---------------start------------->8---
$ docker images
REPOSITORY                      TAG                 IMAGE ID
 CREATED             SIZE
fresh                           latest              c36cef8306d5
 3 weeks ago         1.06GB
singularsyntax/guix-bootstrap   1.1.0-alpine-3.11   c36cef8306d5
 3 weeks ago         1.06GB

$ CONTAINER=`docker run --detach --tty --privileged fresh`
$ docker exec --interactive --tty $CONTAINER /bin/sh
/ # dd if=/dev/urandom of=/DATA bs=1234567 count=1024
dd if=/dev/urandom of=/DATA bs=1234567 count=1024
1024+0 records in
1024+0 records out
/ # exit
exit

$ HASH=`docker commit $CONTAINER` && docker tag $HASH add-data
$ docker stop $CONTAINER && docker rm $CONTAINER
cb89992b76ace2afe5dc6e082c8de121c483dfeeb688d89849713e2cf90b68c7
cb89992b76ace2afe5dc6e082c8de121c483dfeeb688d89849713e2cf90b68c7

$ CONTAINER=`docker run --detach --tty --privileged add-data`
$ docker exec --interactive --tty $CONTAINER /bin/sh
/ # rm /DATA
rm /DATA
/ # dd if=/dev/urandom of=/OTHER bs=1234567 count=1024
dd if=/dev/urandom of=/OTHER bs=1234567 count=1024
1024+0 records in
1024+0 records out
/ # exit
exit

$ HASH=`docker commit $CONTAINER` && docker tag $HASH rm-data-add-other
$ docker stop $CONTAINER && docker rm $CONTAINER
93e9afe593226ec29669efe8515b47487f455d4ad5e012cc67372c2549ec7256
93e9afe593226ec29669efe8515b47487f455d4ad5e012cc67372c2549ec7256

$ CONTAINER=`docker run --detach --tty --privileged rm-data-add-other`
$ docker exec --interactive --tty $CONTAINER /bin/sh
/ # rm /OTHER
rm /OTHER
/ # exit
exit

$ HASH=`docker commit $CONTAINER` && docker tag $HASH rm-other

$ docker stop $CONTAINER && docker rm $CONTAINER
469b341c2f394ef05f5f43a5d96239853e3552d979028a457a9bdd1096a8fab4
469b341c2f394ef05f5f43a5d96239853e3552d979028a457a9bdd1096a8fab4

$ docker images
REPOSITORY                      TAG                 IMAGE ID
 CREATED              SIZE
rm-other                        latest              b80d300aa755
 23 seconds ago       3.59GB
rm-data-add-other               latest              de551eac1d55
 About a minute ago   3.59GB
add-data                        latest              6a563daccccd
 3 minutes ago        2.32GB
fresh                           latest              c36cef8306d5
 3 weeks ago          1.06GB
singularsyntax/guix-bootstrap   1.1.0-alpine-3.11   c36cef8306d5
 3 weeks ago          1.06GB

$ CONTAINER=`docker run --detach --tty --privileged rm-other`
$ docker exec --interactive --tty $CONTAINER /bin/sh
/ # ls /
ls /
bin    dev    etc    gnu    home   lib    media  mnt    opt    proc
root   run    sbin   srv    sys    tmp    usr    var
/ # exit
exit
--8<---------------cut here---------------end--------------->8---

> You'll end up with two new images - the first one should be about 1 GB
> larger than the base image,
> the second one the same size.

As you see, the image 'rm-other' does not container either /DATA or
/OTHER and its size is not the same than the initial one 'fresh'.  So
I do not know if the correct Docker terminology is "layer" because the
issue is definitely on the Docker side and not on the Guix side.


Cheers,
simon


  parent reply	other threads:[~2020-05-31  8:24 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-27 19:41 Guix Docker image inflation Stephen Scheck
2020-05-28 18:10 ` Leo Famulari
2020-05-29 16:19   ` Stephen Scheck
2020-05-29 17:08     ` Leo Famulari
2020-05-29 17:56       ` Stephen Scheck
2020-05-29 18:02         ` Leo Famulari
2020-05-29 18:21           ` Marius Bakke
2020-05-29 18:37             ` Leo Famulari
2020-05-29 18:44               ` zimoun
2020-05-29 21:24                 ` Stephen Scheck
2020-05-29 18:29           ` Stephen Scheck
2020-05-29 17:12     ` zimoun
2020-05-29 17:36       ` Stephen Scheck
2020-05-29 18:08 ` zimoun
2020-05-29 18:47   ` Stephen Scheck
2020-05-29 20:02     ` zimoun
2020-05-29 21:04       ` Stephen Scheck
2020-05-29 21:54         ` zimoun
2020-05-29 22:11           ` Stephen Scheck
2020-05-29 23:30 ` Chris Marusich
2020-05-29 23:55   ` zimoun
2020-05-30 17:13     ` Stephen Scheck
2020-05-31  9:37       ` zimoun
2020-05-31 18:30         ` Stephen Scheck
2020-05-31 18:51           ` zimoun
2020-05-31 19:43             ` Stephen Scheck
2020-05-31 23:27               ` zimoun
2020-05-31 21:04           ` Chris Marusich
2020-06-01  0:37             ` zimoun
2020-05-30 17:02   ` Stephen Scheck
2020-05-31  4:31     ` Chris Marusich
2020-05-31  9:08       ` zimoun
2020-05-31 17:50       ` Stephen Scheck
2020-05-31 18:33         ` zimoun
2020-05-31  8:24     ` zimoun [this message]
2020-05-31 10:50       ` Vincent Legoll
2020-05-31 17:58         ` zimoun

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='CAJ3okZ2PjxUPjdt4tChB=MRT2EvPb69QBOEXut1RSn3SGhU_3A@mail.gmail.com' \
    --to=zimon.toutoune@gmail.com \
    --cc=41607@debbugs.gnu.org \
    --cc=help-guix@gnu.org \
    --cc=singularsyntax@gmail.com \
    /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).