-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
70 lines (51 loc) · 1.9 KB
/
Dockerfile
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
68
69
70
FROM ubuntu:22.04 AS base
RUN apt update && apt install --yes --no-install-recommends \
# add singularity build and singularity pull OS dependencies
ca-certificates squashfs-tools \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
FROM base AS builder
# https://apptainer.org/docs/admin/main/installation.html#install-from-source
RUN apt update && apt install --yes --no-install-recommends \
build-essential \
uuid-dev \
libgpgme-dev \
squashfs-tools \
libseccomp-dev \
wget \
pkg-config \
git \
cryptsetup-bin
ARG TARGETPLATFORM
ARG BUILDPLATFORM
SHELL ["/bin/bash", "-c"]
RUN export VERSION=1.18.2 \
&& export ARCH=linux-${TARGETPLATFORM#'linux/'} \
&& wget --quiet https://go.dev/dl/go${VERSION}.${ARCH}.tar.gz \
&& tar -C /usr/local -xzf go${VERSION}.${ARCH}.tar.gz
ENV PATH=$PATH:/usr/local/go/bin
RUN export VERSION=1.0.2 \
&& cd /tmp \
&& wget --quiet https://github.com/apptainer/apptainer/releases/download/v${VERSION}/apptainer-${VERSION}.tar.gz \
&& tar -xzf apptainer-${VERSION}.tar.gz \
&& mv apptainer-${VERSION} apptainer \
&& cd apptainer \
&& ./mconfig --prefix=/apptainer \
&& make -C builddir \
&& make -C builddir install
FROM base
# Add Apptainer information.
COPY --from=builder /tmp/apptainer/LICENSE*.md /apptainer/
COPY --from=builder /tmp/apptainer/README.md /apptainer/README.md
# Add this Github repository's information.
ADD README.md LICENSE Dockerfile /
# Apptainer executable.
# Full install...
#COPY --from=builder /apptainer /apptainer
# Minimal install... supports singularity pull/build workflows.
COPY --from=builder /apptainer/bin/apptainer /apptainer/bin/apptainer
COPY --from=builder /apptainer/bin/singularity /apptainer/bin/singularity
COPY --from=builder /apptainer/etc/apptainer/apptainer.conf /apptainer/etc/apptainer/apptainer.conf
# Docker image conveniences.
ENV PATH=$PATH:/apptainer/bin
RUN mkdir /output
WORKDIR /output