diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6bdecb08c09e416e88bd50355e2a578ff50c5af3..ef95ca7f2bde818c78aa733681c51f8f6302d4cd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,11 +1,13 @@ image: - name: quay.io/singularity/singularity:v3.11.4-slim + # different images / but all should be comparable + # name: harbor.wolke.img.univie.ac.at/apptainer/singularity:v3.11.4-slim + name: harbor.wolke.img.univie.ac.at/apptainer/apptainer:v1.2.2 entrypoint: ["/bin/sh", "-c"] variables: SFILE: - description: "file path of Singularity recipe file" - value: definition-files/Singularity.almalinux.base + description: "filename of Singularity recipe in definition-files" + value: Singularity.almalinux.base CONTAINERTAG: description: "registry name and tag, e.g. almalinux8:base" value: almalinux8:base @@ -23,4 +25,4 @@ build: when: on_success expire_in: 1 day paths: - - $SFILE.sif + - definition-files/$SFILE.sif diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..695da712b1e6cff0a2fc341c92386a64797b4a83 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,46 @@ +FROM golang:1.20.0-alpine as builder + +################################################################################ +# +# Copyright (C) 2019-2023 Vanessa Sochat. Modified by Michael Blaschek. +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public +# License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. +# +################################################################################ + +# alpine image with the go tools + +RUN apk update && \ + apk add --virtual automake build-base linux-headers libffi-dev +RUN apk add --no-cache bash git openssh gcc squashfs-tools sudo libtool gawk cryptsetup glib-dev +RUN apk add --no-cache linux-headers build-base openssl-dev util-linux util-linux-dev shadow-uidmap libseccomp-dev + +ENV APPTAINER_VERSION=1.2.2 +LABEL Maintainer @mblaschek +RUN wget -qO- https://github.com/apptainer/apptainer/releases/download/v${APPTAINER_VERSION}/apptainer-${APPTAINER_VERSION}.tar.gz | \ + tar xzv && \ + cd apptainer-${APPTAINER_VERSION} && \ + ./mconfig -p /usr/local/apptainer && \ + make -C builddir && \ + make -C builddir install + +# See https://docs.docker.com/develop/develop-images/multistage-build/ +# for more information on multi-stage builds. +FROM alpine:3.17 +LABEL Maintainer @mblaschek +COPY --from=builder /usr/local/apptainer /usr/local/apptainer +RUN apk add --no-cache ca-certificates libseccomp squashfs-tools tzdata bash && \ + cp /usr/share/zoneinfo/UTC /etc/localtime +ENV PATH="/usr/local/apptainer/bin:$PATH" +ENTRYPOINT ["/usr/local/apptainer/bin/singularity"]