forked from nickjer/singularity-r
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSingularity-baseimage
54 lines (38 loc) · 1.36 KB
/
Singularity-baseimage
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
Bootstrap: scratch
%labels
Maintainer Moritz Lell
git_repository https://github.com/mlell/singularity-r
%help
Debian base image, obtained from snapshot.debian.org to enable reproducible build
%setup
if [ -z "${DEBUG-}" ]; then
# make sure it doesn't fail
git status -s &>/dev/null
if [ ! "$(git status -s | wc -l)" = "0" ]; then
echo "Working dir dirty!" >&2
exit 1
fi
git rev-parse HEAD >"$SINGULARITY_ROOTFS/commit"
else
echo "debug" > "$SINGULARITY_ROOTFS/commit"
fi
# To keep the package cache and avoid redownload when re-running build.sh
mkdir -p "$SINGULARITY_ROOTFS/var/lib/apt"
mkdir -p "$SINGULARITY_ROOTFS/var/cache/apt"
mount -o bind "$PWD/vca" "$SINGULARITY_ROOTFS/var/cache/apt"
mount -o bind "$PWD/vca" "$SINGULARITY_ROOTFS/var/lib/apt"
trap '
umount "$SINGULARITY_ROOTFS/var/lib/apt"
umount "$SINGULARITY_ROOTFS/var/cache/apt"
' EXIT
debootstrap \
--keyring=$HOME/.gnupg/pubring.gpg \
bookworm \
"$SINGULARITY_ROOTFS" \
https://snapshot.debian.org/archive/debian/20240926T083932Z/
%post
# For ssl3, can remove if newer RStudio versions can do without this
# cat <<EOF >>/etc/apt/sources.list
#deb https://snapshot.debian.org/archive/debian-security/20240926T121404Z/ debian-security bookwork-#security main
#EOF
echo "git_commit $(cat /commit)" >> "$SINGULARITY_LABELS"