11Bootstrap: docker
2- From: python :3.12
3- Stage: spython-base
2+ From: pypy :3.11-slim-trixie
3+ Stage: build
44
55%arguments
66# The default images of python are based on debian
77# These arguments help customizing what it is included in the generated image
8- wfexs_checkout=574fe343c0b59eecd95afbc67894456359ebe649
9- apptainer_version=1.3.6
8+ wfexs_checkout=eb5d0f0fc95c60e545b0c96ec8da0efff0a7d74b
9+ apptainer_version=1.4.3
1010# JDK version parameters
1111JDK_MAJOR_VER=11
1212# Nested arguments are not allowed
@@ -16,7 +16,7 @@ OPENJ9_VER=0.26.0
1616# Go version to compile
1717GO_VER=1.20.14
1818# gocryptfs version
19- GOCRYPTFS_VER=v2.4.0
19+ GOCRYPTFS_VER=v2.6.1
2020# static bash version
2121STATIC_BASH_VER=5.1.004-1.2.2
2222# static busybox version
@@ -25,56 +25,79 @@ BUSYBOX_VER=1.35.0
2525
2626%post
2727set -ue
28- # Install apptainer
28+
29+ cd /
30+
31+ # Install preconditions (including apptainer)
2932DPKG_ARCH=$(dpkg --print-architecture) && \
30- wget -nv \
31- https://github.com/apptainer/apptainer/releases/download/v{{ apptainer_version }}/apptainer_{{ apptainer_version }}_${DPKG_ARCH}.deb \
32- https://github.com/apptainer/apptainer/releases/download/v{{ apptainer_version }}/apptainer-suid_{{ apptainer_version }}_${DPKG_ARCH}.deb && \
3333apt-get update && \
34- apt-get install -y ./*.deb && \
35- rm -f *.deb
36- # Install docker-ce-cli
37- # hadolint ignore=DL3008
38- wget -nv -O /etc/apt/keyrings/docker.asc https://download.docker.com/linux/debian/gpg && \
39- chmod a+r /etc/apt/keyrings/docker.asc && \
40- echo \
41- "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
42- $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
43- tee /etc/apt/sources.list.d/docker.list > /dev/null && \
44- apt-get update && \
45- apt-get install -y --no-install-recommends docker-ce-cli
46- # Install both podman, encfs and graphviz
47- # hadolint ignore=DL3008
48- apt-get install -y podman encfs graphviz
34+ apt-get install -y --no-install-recommends wget build-essential git libxml2-dev libxslt-dev zlib1g-dev && \
35+ wget -nv -O /tmp/rust-installer.sh https://sh.rustup.rs && \
36+ chmod +x /tmp/rust-installer.sh && \
37+ /tmp/rust-installer.sh -y && \
38+ wget -nv \
39+ https://github.com/apptainer/apptainer/releases/download/v"{{ apptainer_version }}"/apptainer_"{{ apptainer_version }}"-trixie+_"${DPKG_ARCH}".deb \
40+ https://github.com/apptainer/apptainer/releases/download/v"{{ apptainer_version }}"/apptainer-suid_"{{ apptainer_version }}"-trixie+_"${DPKG_ARCH}".deb && \
41+ apt-get install -y --no-install-recommends ./*.deb
42+
4943# Install WfExS, trusting the installers in the commit rather than the
5044# one in the docker recipe
51- mkdir -p /
52- cd /
53- # hadolint ignore=DL3003
5445git clone --filter=blob:none --no-checkout https://github.com/inab/WfExS-backend.git && \
5546cd WfExS-backend && \
5647git sparse-checkout init --cone && \
57- PYVER=$(python -c 'import sys; print("{}.{}".format(sys.version_info.major, sys.version_info.minor))') && \
58- git sparse-checkout set constraints-${PYVER}.txt container_recipes/basic-installer.bash container_recipes/full-installer.bash && \
48+ PYVER=$(python -c 'import sys; import platform ; print("{}{}.{}".format("pypy" if platform.python_implementation() == "PyPy" else "", sys.version_info.major, sys.version_info.minor))') && \
49+ git sparse-checkout set constraints-${PYVER}.txt \
50+ podman_containers_nokeyring.conf \
51+ container_recipes/basic-installer.bash \
52+ container_recipes/full-installer.bash && \
5953git checkout "{{ wfexs_checkout }}" && \
60- pip install --no-cache-dir "git+https://github.com/inab/WfExS-backend.git@{{ wfexs_checkout }}" -c constraints-${PYVER}.txt && \
54+ grep -vF git+ constraints-${PYVER}.txt > constraints-${PYVER}.txt-relaxed && \
55+ . "${HOME}"/.cargo/env && \
56+ pip install --no-cache-dir --upgrade pip wheel && \
57+ pip install --no-cache-dir "git+https://github.com/inab/WfExS-backend.git@{{ wfexs_checkout }}" -c constraints-"${PYVER}".txt-relaxed && \
6158python -m compileall "$(python -c 'import sys; print(sys.prefix)')" && \
62- mv container_recipes/* / && \
63- cd .. && \
64- rm -rf WfExS-backend
65- # Transfer other third party installation script
66- # COPY basic-installer.bash full-installer.bash ./
59+ mv container_recipes/* /
60+
6761# Install third party software
62+ apt-get install -y --no-install-recommends curl libmagic1 graphviz && \
6863JDK_MAJOR_VER="{{ JDK_MAJOR_VER }}" \
6964JDK_VER="{{ JDK_VER }}" \
70- JDK_REV="{{JDK_REV }}" \
65+ JDK_REV="{{ JDK_REV }}" \
7166OPENJ9_VER="{{ OPENJ9_VER }}" \
7267GO_VER="{{ GO_VER }}" \
7368GOCRYPTFS_VER="{{ GOCRYPTFS_VER }}" \
7469STATIC_BASH_VER="{{ STATIC_BASH_VER }}" \
7570BUSYBOX_VER="{{ BUSYBOX_VER }}" \
7671bash /full-installer.bash
7772
73+ Bootstrap: docker
74+ From: pypy:3.11-slim-trixie
75+ Stage: image
76+
77+ %files from build
78+ /podman_containers_nokeyring.conf /etc/containers/containers.conf
79+ /opt/pypy /opt
80+ /*.deb /tmp/
81+
82+ %post
83+ set -ue
84+
85+ # Install docker-ce-cli
86+ # Cleanups
87+ DPKG_ARCH=$(dpkg --print-architecture) && \
88+ python -c 'import urllib.request ; urllib.request.urlretrieve("https://download.docker.com/linux/debian/gpg", "/etc/apt/keyrings/docker.asc")' && \
89+ chmod a+r /etc/apt/keyrings/docker.asc && \
90+ echo \
91+ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
92+ $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
93+ tee /etc/apt/sources.list.d/docker.list > /dev/null && \
94+ apt-get update && \
95+ apt-get install -y --no-install-recommends git libmagic1 libxml2 libxslt1.1 zlib1g python3-venv podman encfs graphviz docker-ce-cli wget && \
96+ apt-get install -y --no-install-recommends /tmp/*.deb && \
97+ apt-get clean && \
98+ rm -f /tmp/*.deb /var/cache/apt/archives/*.deb && \
99+ rm -rf /var/lib/apt/lists/*
100+
78101%runscript
79102cd /
80103exec /bin/bash bash "$@"
0 commit comments