This repository has been archived on 2024-06-20. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
coffee.pygments/tests/examplefiles/singularity/Singularity
Oleh Prypin 6f43092173
Also add auto-updatable output-based tests to examplefiles (#1689)
Co-authored-by: Georg Brandl <georg@python.org>
2021-01-20 10:48:45 +01:00

45 lines
1 KiB
Text

BoOtStRaP: library # pass: headers are case-insensitive
# pass: do not highlight '%'
MirrorURL: http://mirror.centos.org/centos-%{OSVERSION}/%{OSVERSION}/os/$basearch/
From: ubuntu:18.04 # pass: leading whitespace allowed
%setup
touch /file1
touch ${SINGULARITY_ROOTFS}/file2 # pass: leading whitespace optional
%files
/file1
/file1 /opt
%environment
export LISTEN_PORT=12345
export LC_ALL=C
%runscript
echo "Container was created $NOW"
echo "Arguments received: $*"
exec echo "$@"
%startscript
nc -lp $LISTEN_PORT
%test
grep -q NAME=\"Ubuntu\" /etc/os-release
if [ $? -eq 0 ]; then
echo "Container base is Ubuntu as expected."
else
echo "Container base is not Ubuntu."
fi
%labels
Author d@sylabs.io
Version v0.0.1
%help
This is a demo container used to illustrate a def file that uses all
supported sections.
%post
apt-get update && apt-get install -y netcat
NOW=$((date % 1)) # pass: don't highlight '%'
echo "export NOW=\"${NOW}\"" >> $SINGULARITY_ENVIRONMENT