Skip to content

Commit 6319c55

Browse files
committed
Use APPTAINER_BINDPATH instead of APPTAINER_HOME
Not all software was happy with a read-only $HOME directory. So use the regular VM $HOME, but do bind-mount host $HOME. Signed-off-by: Anders F Björklund <[email protected]>
1 parent f654a0c commit 6319c55

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

cmd/apptainer.lima

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
#!/bin/sh
22
set -eu
33
: "${LIMA_INSTANCE:=apptainer}"
4+
: "${APPTAINER_BINDPATH:=}"
45

56
if [ "$(limactl ls -q "$LIMA_INSTANCE" 2>/dev/null)" != "$LIMA_INSTANCE" ]; then
67
echo "instance \"$LIMA_INSTANCE\" does not exist, run \`limactl create --name=$LIMA_INSTANCE template://apptainer\` to create a new instance" >&2
78
exit 1
89
fi
910
export LIMA_INSTANCE
10-
exec lima APPTAINER_HOME="$HOME" apptainer "$@"
11+
if [ -n "$APPTAINER_BINDPATH" ]; then
12+
APPTAINER_BINDPATH="$APPTAINER_BINDPATH,"
13+
fi
14+
APPTAINER_BINDPATH="$APPTAINER_BINDPATH$HOME"
15+
exec lima APPTAINER_BINDPATH="$APPTAINER_BINDPATH" apptainer "$@"

0 commit comments

Comments
 (0)