GNU bug report logs - #71674
guix pack: Cannot pass environment variables via apptainer

Previous Next

Package: guix;

Reported by: Lars Bilke <lars.bilke <at> ufz.de>

Date: Thu, 20 Jun 2024 11:38:02 UTC

Severity: normal

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Lars Bilke <lars.bilke <at> ufz.de>
To: bug-guix <at> gnu.org
Subject: guix pack: Cannot pass environment variables via apptainer
Date: Thu, 20 Jun 2024 13:36:57 +0200
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#L646 and https://github.com/apptainer/apptainer/blob/main/internal/pkg/runtime/engine/config/oci/generate/generate.go#L98) so they should work.

Thanks,
Lars




This bug report was last modified 1 year and 22 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.