1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
|
bootstrap: oras
from: ghcr.io/apptainer/alpine:3.15.0
%labels
maintainer "Apptainer Team <tsc@apptainer.org>"
%help
export BAD_GUY=Thanos
export SMART_GUY=tony
%environment
GOPATH=/go
PATH=$PATH:$GOPATH/bin:/usr/local/go/bin
CGO_ENABLED=0
AVENGERS=assemble
export GOPATH PATH CGO_ENABLED AVENGERS
%setup
echo "SETUP"
# to test extraction to a sandbox for non root users
mknod $APPTAINER_ROOTFS/dev/null c 1 3
%appenv testapp
TESTAPP=testapp
export TESTAPP
%appinstall testapp
echo 'echo $TESTAPP' > $SCIF_APPROOT/bin/testapp.sh
chmod 0755 $SCIF_APPROOT/bin/testapp.sh
%apprun testapp
$TESTAPP.sh
%appinstall foo
echo "INSTALLING FOO"
touch filefoo.exec
%appinstall bar
echo "INSTALLING BAR"
touch filebar.exec
%apphelp foo
This is the help for foo!
%applabels foo
HELLOTHISIS foo
%applabels bar
HELLOTHISIS bar
%appenv foo
HELLOTHISIS=foo
export HELLOTHISIS
%apprun foo
echo "RUNNING FOO"
%appstart foo
echo "STARTING FOO"
# Echo back reverse of strings sent on port $1
exec nc -l -k -p $1 -e /bin/rev
%startscript
# Echo back strings sent on port $1
exec nc -l -k -p $1 -e /bin/cat
%runscript
echo "Running command: $*"
exec "$@"
%post
echo "POST"
# Needed for startscript
apk update
apk add nmap-ncat
# for symlink tests, ensure runtime will bind
# in the image and not on /etc on host filesystem
ln -s /etc /var/etc
mkdir /madness
ln -s /madness /var/etc/madness
# for underlay regression tests
ln -s ../usr/share/zoneinfo/Etc/UTC /etc/relative-slink
ln -s /usr/share/zoneinfo/Etc/UTC /etc/absolute-slink
%test
exec "$@"
|