bootstrap: oras
from: ghcr.io/apptainer/alpine:3.15.0

%help
This is a e2e test container used for testing the 'inspect'
command. This container "inspector_container.sif" should be placed
in the "e2e/testdata" directory of Apptainer.

%labels
MAINTAINER "WestleyK <westley@sylabs.io>"
e2e awesome
E2E AWESOME
hi "hello world"
HI "HELLO WORLD"

%post
echo "export hello=\"world\"" >> $APPTAINER_ENVIRONMENT
# add labels from post section
k=first; echo "$k.build.labels  $k" >> $APPTAINER_LABELS
k=second; echo "$k.build.labels $k" >> $APPTAINER_LABELS

%test
ls /
test -d /
test -d /etc

%environment
export test="testing"
export e2e="e2e testing"

%runscript
cat /.singularity.d/runscript.help

%startscript
exec "$@"

%apprun hello
echo "hello"

%appstart hello
exec "$@"

%apphelp hello
This is the help for hello!

%applabels hello
HELLOTHISIS hello

%appenv hello
HELLOTHISIS=hello
export HELLOTHISIS

%apptest hello
echo "THIS IS A HELLO TEST"

%apprun world
echo "world"
