help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Guix Docker image inflation


From: Leo Famulari
Subject: Re: Guix Docker image inflation
Date: Thu, 28 May 2020 14:10:43 -0400

On Wed, May 27, 2020 at 03:41:49PM -0400, Stephen Scheck wrote:
> As an exercise, I set up daily Guix System Docker image builds using GitLab
> and Docker Hub, here:
> https://hub.docker.com/repository/registry-1.docker.io/singularsyntax/guix/tags?page=1

Cool!

> The build process works as follows: if an existing `latest` image does not
> exist for a given branch (master, 1.1.0, etc.), then bootstrap an image by
> running `guix system docker-image` inside an Alpine Linux Docker container
> with a fresh Guix installation. Using this image as a seed, `guix pull` is
> run for the desired branch, and the resulting image is committed to the
> Docker repository. If a "latest" image does exist, it is used instead as
> the base from which to run `guix pull`. Daily images are thus built
> incrementally from the previous day's build. For anybody curious about the
> process, the build script can be browsed here:
> https://gitlab.com/singularsyntax-docker-hub/guix/-/blob/master/.gitlab-ci.yml

I'm not familiar with Docker so I'm not sure exactly what you are doing.
Specifically, I can't tell if you are creating new Docker images from
scratch each day, or if you are continuing to use the same one from day
to day.

> It works pretty well, except that I'm observing substantial image size
> inflation day-over-day, starting at ~197 MB from the seed image, now up to
> 1.71 GB eleven days later despite running `guix gc --delete-generations`,
> `guix gc --collect-garbage`, and `guix gc --optimize` after pulling prior
> to committing each new image.

I'm also not sure which image is growing each day...

In general, the parameters --delete-generations and --collect-garbage
are supposed to be passed values like a reference to a profile or an
amount of data to delete, respectively. Are you doing that?

Are you removing / invalidating old generations before attempting to
garbage collect them? The store items they refer to cannot be deleted
until the generations themselves are no longer registered.

You can list existing generations with e.g. `guix package
--list-generations`. You can invalidate them with `guix package
--delete-generations=42` or with time-based patterns like `guix package
--delete-generations=1m`, which removes everything older than one month.
The same-named argument to `guix gc` should be shorthand for that.

Similarly for the profile used by `guix pull`, which is accessed like
this: `guix package --profile=$HOME/.config/guix/current
--list-generations`.

Usually, these old profiles are responsible for most of the disk usage
in /gnu/store.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]