From: Danny Milosavljevic <dannym@scratchpost.org>
To: zimoun <zimon.toutoune@gmail.com>
Cc: guix-devel@gnu.org, Ryan Prior <ryanprior@hey.com>
Subject: Re: Release: Docker Image? DockerHub? skopeo?
Date: Thu, 19 Nov 2020 11:49:11 +0100 [thread overview]
Message-ID: <20201119114829.5f77f516@scratchpost.org> (raw)
In-Reply-To: <86zh3d1z3n.fsf@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2075 bytes --]
Hi zimoun,
On Thu, 19 Nov 2020 10:21:16 +0100
zimoun <zimon.toutoune@gmail.com> wrote:
> Let’s postpone this Docker image work and start a new fresh thread once
> v1.2.0 is published and the goal to have something for v1.3.0, well
> that’s my point of view.
After Ryan Prior's E-Mail I'm pretty sure my workaround of creating /tmp,
/etc/passwd, /etc/group etc is what Docker actually expects one to do.
So we can just create those--either at runtime, or maybe even have
guix system docker-image
do it at build time (if it doesn't already).
I have no opinion on when we should do that (at this release or the next
one), except to state that I am certain that it works (and pretty easily),
because guix-on-docker does that already and guix works just fine there.
That still leaves to explain how to prevent Docker from keeping older layers
when it doesn't need to.
In guix-on-docker I have a Dockerfile like this
FROM alpine:3.12 AS bootstrap-guix-on-alpine
[...]
FROM scratch AS guix-on-docker
COPY --from=bootstrap-guix-on-alpine /etc/guix /etc/guix
COPY --from=bootstrap-guix-on-alpine /var/guix /var/guix
COPY --from=bootstrap-guix-on-alpine /gnu /gnu
COPY --from=bootstrap-guix-on-alpine /usr/local /usr/local
COPY --from=bootstrap-guix-on-alpine /root/.config/guix /root/.config/guix
ADD set-mtimes.scm /
ADD etc/passwd /etc
ADD etc/group /etc
ADD etc/services /etc
ADD with-guix-daemon.scm /
RUN ["/usr/local/bin/guix", "repl", "/set-mtimes.scm"]
in order to prevent Docker from keeping older layers[1].
The "set-times.scm" invocation there is in order to fix the timestamps.
"COPY --from=" does not preserve timestamps. Then guile is very annoyed
because it can't use any of the ".go" files--because they are older than
the respective ".scm" files.
Using set-times.scm means it will create yet another layer where the only
difference is the timestamps--so it doubles the size of the resulting image.
But then it works.
[1] https://docs.docker.com/develop/develop-images/multistage-build/
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2020-11-19 10:49 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-22 9:51 Releasing guix binary in Docker format too? Danny Milosavljevic
2020-09-23 11:07 ` Pjotr Prins
2020-09-23 12:53 ` zimoun
2020-09-24 7:59 ` Danny Milosavljevic
2020-10-20 10:29 ` zimoun
2020-10-21 9:12 ` Ludovic Courtès
2020-10-21 10:57 ` zimoun
2020-10-21 15:42 ` Ludovic Courtès
2020-11-04 14:43 ` Danny Milosavljevic
2020-11-06 9:59 ` Ludovic Courtès
2020-11-06 12:47 ` zimoun
2020-11-06 13:28 ` Danny Milosavljevic
2020-11-08 17:33 ` Ludovic Courtès
2020-11-15 18:30 ` zimoun
2020-11-17 16:38 ` Danny Milosavljevic
2020-11-18 12:56 ` Bengt Richter
2020-11-18 13:52 ` Ryan Prior
2020-11-18 14:25 ` zimoun
2020-10-21 11:04 ` Size of package 'guix' zimoun
2020-10-21 15:44 ` Ludovic Courtès
2020-10-21 16:04 ` zimoun
2020-11-04 11:05 ` Release: Docker Image? DockerHub? skopeo? zimoun
2020-11-04 13:44 ` Jelle Licht
2020-11-04 14:50 ` Danny Milosavljevic
2020-11-15 21:30 ` zimoun
2020-11-17 16:31 ` Danny Milosavljevic
2020-11-17 16:50 ` Danny Milosavljevic
2020-11-17 17:30 ` zimoun
2020-11-17 19:23 ` Danny Milosavljevic
2020-11-17 19:28 ` Danny Milosavljevic
2020-11-17 21:44 ` Ryan Prior
2020-11-17 22:05 ` Carlo Zancanaro
2020-11-19 9:21 ` zimoun
2020-11-19 10:49 ` Danny Milosavljevic [this message]
2020-11-20 11:34 ` /etc/passwd & co. in Docker images Ludovic Courtès
2020-11-20 18:53 ` Ryan Prior
2020-11-22 16:00 ` Danny Milosavljevic
2020-11-22 16:49 ` Ryan Prior
2020-11-29 12:51 ` Danny Milosavljevic
2020-12-05 15:08 ` Ludovic Courtès
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=20201119114829.5f77f516@scratchpost.org \
--to=dannym@scratchpost.org \
--cc=guix-devel@gnu.org \
--cc=ryanprior@hey.com \
--cc=zimon.toutoune@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.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
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).