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

To reply to this bug, email your comments to 71674 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#71674; Package guix. (Thu, 20 Jun 2024 11:38:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Lars Bilke <lars.bilke <at> ufz.de>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Thu, 20 Jun 2024 11:38:02 GMT) Full text and rfc822 format available.

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 119 days ago.

Previous Next


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