unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Docker export: add /etc/environment?
@ 2017-08-21 10:02 Ricardo Wurmus
  2017-08-21 11:03 ` Andy Wingo
  2017-08-22  9:05 ` Ludovic Courtès
  0 siblings, 2 replies; 3+ messages in thread
From: Ricardo Wurmus @ 2017-08-21 10:02 UTC (permalink / raw)
  To: guix-devel

Hi Guix,

I just used Guix to export a Docker image for a genomics pipeline our
research group has worked on.  In order to run the tool in the container
a couple of environment variables have to be set, such as TZDIR, LC_ALL,
GUIX_LOCPATH, and PATH.

Currently, this must be done by users leading to ugly Docker command
lines, such as this:

    docker run --rm \
      -e TZDIR=/share/zoneinfo \
      -e LC_ALL=en_US.UTF-8 \
      -e GUIX_LOCPATH=/lib/locale \
      -e PATH=/bin \
      -v $PWD:/foo -w /foo \
      --tmpfs /tmp \
      -ti $image \
      /bin/pigx_bs ./test/Tablesheet.txt

This depends on exporting a profile with “share”, “lib”, and “bin”
linked to the root level:

    guix pack -e '(load "guix.scm")' \
      -f docker \
      -S /bin=bin -S /lib=lib -S /share=share \
      glibc-utf8-locales gzip tzdata coreutils

(“guix.scm” evaluates to the pipeline package.)

Is there (or should there be) a way to populate /etc/environment such
that all these environment variables are set automatically?

Especially for “guix pack -f docker” it makes sense to me to include a
default “/etc/environment” that includes things we set up in GuixSD by
default, such as GUIX_LOCPATH, and that sources the packed profile’s
“etc/profile”.

What do you think?

-- Ricardo

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Docker export: add /etc/environment?
  2017-08-21 10:02 Docker export: add /etc/environment? Ricardo Wurmus
@ 2017-08-21 11:03 ` Andy Wingo
  2017-08-22  9:05 ` Ludovic Courtès
  1 sibling, 0 replies; 3+ messages in thread
From: Andy Wingo @ 2017-08-21 11:03 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

On Mon 21 Aug 2017 12:02, Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> writes:

> Especially for “guix pack -f docker” it makes sense to me to include a
> default “/etc/environment” that includes things we set up in GuixSD by
> default, such as GUIX_LOCPATH, and that sources the packed profile’s
> “etc/profile”.
>
> What do you think?

Go for it!! :)

Andy

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Docker export: add /etc/environment?
  2017-08-21 10:02 Docker export: add /etc/environment? Ricardo Wurmus
  2017-08-21 11:03 ` Andy Wingo
@ 2017-08-22  9:05 ` Ludovic Courtès
  1 sibling, 0 replies; 3+ messages in thread
From: Ludovic Courtès @ 2017-08-22  9:05 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel

Hello,

Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> skribis:

> Especially for “guix pack -f docker” it makes sense to me to include a
> default “/etc/environment” that includes things we set up in GuixSD by
> default, such as GUIX_LOCPATH, and that sources the packed profile’s
> “etc/profile”.
>
> What do you think?

That sounds useful, though you still need something to read
/etc/environment, or does Docker do it automatically?

Looking at
<https://github.com/moby/moby/blob/master/image/spec/v1.2.md>, perhaps
the right way would be to define “Env” in the JSON file of the image?

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-08-22  9:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-21 10:02 Docker export: add /etc/environment? Ricardo Wurmus
2017-08-21 11:03 ` Andy Wingo
2017-08-22  9:05 ` Ludovic Courtès

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).