-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
68 lines (44 loc) · 1.66 KB
/
Dockerfile
File metadata and controls
68 lines (44 loc) · 1.66 KB
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
FROM docker.io/debian:12.11 AS bootstrap
RUN apt-get update && apt-get install -y \
build-essential \
ca-certificates \
git \
libc6-dev \
python3
RUN git clone -c feature.manyFiles=true --depth=2 https://github.com/spack/spack.git /spack
ENV PATH="${PATH}:/spack/bin"
COPY spack.yaml /root/spack-env/spack.yaml
RUN spack compiler find
RUN sed -i '/spec: gcc/s/$/ build_type=Release/' /root/.spack/packages.yaml
RUN sed -i '/gcc.*+strip/s/+strip/~strip/' /root/spack-env/spack.yaml
RUN spack -e /root/spack-env concretize
RUN spack -e /root/spack-env fetch -D
RUN spack -e /root/spack-env install --fail-fast --fresh
RUN spack view add -i /bootstrap-view $(spack find -H)
FROM docker.io/debian:12.11 AS base
RUN apt-get update && apt-get install -y \
libc6-dev
COPY --from=bootstrap /spack /spack
COPY --from=bootstrap /bootstrap-view /bootstrap-view
ENV PATH="/bootstrap-view/bin:/spack/bin:${PATH}"
COPY spack.yaml /root/spack-env/spack.yaml
RUN spack compiler find /bootstrap-view/bin
RUN sed -i '/spec: gcc/s/$/ ~strip/' /root/.spack/packages.yaml
RUN spack -e /root/spack-env concretize -Uf
RUN spack -e /root/spack-env install --fail-fast --fresh
RUN spack clean -ab
RUN spack gc -e /root/spack-env -y
FROM scratch
COPY --from=base /spack /spack
COPY --from=base /view /view
COPY --from=base /python-view /python-view
COPY --from=base /usr/lib /usr/lib/
COPY --from=base /usr/include /usr/include
ENV SPACK_PYTHON=/python-view/bin/python3
ENV PATH=/view/bin:/spack/bin
SHELL ["/view/bin/bash", "-c"]
RUN ln -s /view/bin /usr/bin
RUN ln -s /view/bin /bin
RUN spack compiler find
RUN spack bootstrap now
ENTRYPOINT ["/view/bin/bash", "-l", "-c"]