generated from seanpm2001/Git-Template_V8
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
PROJECT_LANG_1.singularity
67 lines (51 loc) · 1.88 KB
/
PROJECT_LANG_1.singularity
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
Bootstrap: library
From: ubuntu:18.04
Stage: build
# Start of script
# Notes
# I don't know how to make strings in Singularity, so comments will do for now
# I know that Singularity files don't have an extension, that is being done here for reference purposes.
# Project language file 1
# For: seanpm2001/Learn-Singularity
# About:
# I decided to make Singularity the main project language file for this project (Seanpm2001/Learn-Singularity) as Singularity is the language this project is dedicated to, because this project is about learning the Singularity programming language. It only makes sense to Singularity the official language for this project. It is getting its own project language file, starting here.
# Now for a Singularity build file:
# https://www.sylabs.io/guides/3.2/user-guide/definition_files.html
%setup
touch /file1
touch ${SINGULARITY_ROOTFS}/file2
%files
/file1
/file1 /opt
%environment
export LISTEN_PORT=12345
export LC_ALL=C
%post
apt-get update && apt-get install -y netcat
NOW=`date`
echo "export NOW=\"${NOW}\"" >> $SINGULARITY_ENVIRONMENT
%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.
# Taken and modified from: https://github.com/onnovalkering/vscode-singularity/blob/master/test/Singularity
# File info
# File type: Singularity source file (*Singularity *Apptainer)
# File version: 1 (2022, Monday, August 29th at 4:13 pm PST)
# Line count (including blank lines and compiler line): 68
# End of script