guix pack: Cannot pass environment variables via apptainer

  • Open
  • quality assurance status badge
Details
One participant
  • Lars Bilke
Owner
unassigned
Submitted by
Lars Bilke
Severity
normal
L
L
Lars Bilke wrote on 20 Jun 13:36 +0200
(address . bug-guix@gnu.org)
9EA54A62-0D54-4992-B8A4-8B625286F605@ufz.de
I have created a squashfs image with e.g.

guix pack --format=squashfs bash coreutils

Then I run this image with apptainer / singularity and want to pass environment variables like this:

APPTAINERENV_VAR1=FOO apptainer exec --env "VAR2=BAR" /gnu/store/v27n3gwdl3hn01bmm1ad4z1jkw51cz1r-bash-coreutils-squashfs-pack.gz.squashfs env

Both VAR1 and VAR2 do not show up in the container but they should.

Passing regular environment varialbles work:

VAR3=BAZ APPTAINERENV_VAR1=FOO apptainer exec --env "VAR2=BAR" /gnu/store/v27n3gwdl3hn01bmm1ad4z1jkw51cz1r-bash-coreutils-squashfs-pack.gz.squashfs env
...
VAR3=BAZ
...

Any idea how to fix that? As I understand these variables are directly passed to the process (https://github.com/apptainer/apptainer/blob/317123280e39abcefb309716c07e0af85edbad88/internal/pkg/runtime/engine/apptainer/process_linux.go#L646and https://github.com/apptainer/apptainer/blob/main/internal/pkg/runtime/engine/config/oci/generate/generate.go#L98) so they should work.

Thanks,
Lars
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 71674@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 71674
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch