guix-devel
[Top][All Lists]
Advanced

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

Docker export: add /etc/environment?


From: Ricardo Wurmus
Subject: Docker export: add /etc/environment?
Date: Mon, 21 Aug 2017 12:02:39 +0200
User-agent: mu4e 0.9.18; emacs 25.2.1

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



reply via email to

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