unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Danny Milosavljevic <dannym@scratchpost.org>
To: zimoun <zimon.toutoune@gmail.com>
Cc: guix-devel@gnu.org
Subject: Re: Release: Docker Image? DockerHub? skopeo?
Date: Tue, 17 Nov 2020 20:23:20 +0100	[thread overview]
Message-ID: <20201117202320.3e12fff0@scratchpost.org> (raw)
In-Reply-To: <868sazoppq.fsf@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3158 bytes --]

Hi zimoun,

On Tue, 17 Nov 2020 18:30:57 +0100
zimoun <zimon.toutoune@gmail.com> wrote:

> > Yeah, someone needs to create /tmp.  That someone is not Guix (it
> > would be weird).  
> 
> Created where?

Created when creating the docker image--presumably by Docker when evaluating
Composefile.

AFAIK Docker images are supposed to be composed of multiple things using a
Composefile.[1]

So Docker has to have some mechanism to set up the shared space that all those
multiple things need.

Ideally, we/the user should use this mechanism to add /tmp--not create it
manually by some weird script in the running container.

> If with the container:
> 
> --8<---------------cut here---------------start------------->8---
> docker exec guix mkdir -h
> OCI runtime exec failed: exec failed: container_linux.go:349: starting container process caused "exec: \"mkdir\": executable file not found in $PATH": unknown

You have to use guix repl, then it will work.
There's no coreutils in there, just guix.

That's what /with-guix-daemon.scm in guix-on-docker does (it's already in the
image), among other weird things.

I paste it in full here:

(use-modules (ice-9 match))
(if (not (file-exists? "/tmp"))
    (mkdir "/tmp"))
(system "/root/.config/guix/current/bin/guix-daemon --build-users-group=guixbuild --disable-chroot &")
(sleep 2)
(match (command-line)
 ((me next-executable rest ...)
  (match (cons next-executable rest)
   ;; gitlab runner invokes "sh -c" for a shell existence check.
   ;; Replace it by bash.
   (("sh" "-c" rest ...)
    (apply execlp "guix" '("guix" "environment" "--ad-hoc" "bash" "coreutils" "--" "bash")))
   ((next-executable rest)
    (apply execlp next-executable (cons next-executable rest)))))
 ((me)
  ;; For gitlab runner, see <https://docs.gitlab.com/ee/ci/docker/using_docker_images.html#overriding-the-entrypoint-of-an-image>.
  (apply execlp "guix" '("guix" "repl"))))
(exit 1)

It's used as entrypoint by me manually (because it's full of weird workarounds
like this it's NOT the default entrypoint), overriding docker's entrypoint by
["guix", "repl", "--", "/with-guix-daemon.scm"].

> Sorry to be so naive.

No, I don't use docker that much--and when I do, it's to run simple images
others have created.  So I just really don't know how this is supposed to
be set up.  I mean there has to be a way to set this up--that is one of the
first things anyone would need--shared /tmp, /etc/passwd, /etc/group,
/etc/services and so on.  The parts that are composed together by Docker have
to negotiate a common version of those, right?

> > /tmp is a common directory, so it does not belong to any of the parts that
> > have been composed, or maybe there should be a standard "/tmp" part?
> >
> > Is there such a standard "/tmp" part in Docker-land?
> >
> > Similarly, but worse, with /etc/passwd, /etc/group, /etc/services and so on.  
> 
> I do not know.

I hope that others will chime in explaining what the standard way to do this
is.  The workaround above *does* work, though (and is the wrong thing to do).

[1] https://docs.docker.com/compose/

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2020-11-17 19:24 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 [this message]
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
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=20201117202320.3e12fff0@scratchpost.org \
    --to=dannym@scratchpost.org \
    --cc=guix-devel@gnu.org \
    --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).