-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathDockerfile-base-ubuntu20.04-gcc11.2
42 lines (31 loc) · 1.42 KB
/
Dockerfile-base-ubuntu20.04-gcc11.2
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
# Build stage with Spack pre-installed and ready to be used
FROM ecpe4s/rhel8-runner-x86_64:2021-09-01-gcc11.2 as builder
RUN mkdir /opt/spack-environment
# What we want to install and how we want to install it
# # is specified in a manifest file (spack.yaml)
COPY spack_gnu.yaml /opt/spack-environment/spack.yaml
# Install the software, remove unnecessary deps
RUN cd /opt/spack-environment && \
. /spack/share/spack/setup-env.sh && \
spack compiler find && \
spack env create -d . && \
spack env activate . && \
spack install --dirty && \
spack gc -y
# Strip all the binaries
RUN find -L /opt/view/* -type f -exec readlink -f '{}' \; | \
xargs file -i | \
grep 'charset=binary' | \
grep 'x-executable\|x-archive\|x-sharedlib' | \
awk -F: '{print $1}' | xargs strip -s
# Modifications to the environment that are necessary to run
RUN cd /opt/spack-environment && \
. /spack/share/spack/setup-env.sh && \
spack env activate --sh -d . >> /etc/profile.d/z10_spack_environment.sh
# Bare OS image to run the installed executables
FROM ecpe4s/rhel8-runner-x86_64:2021-09-01-gcc11.2
COPY --from=builder /opt/spack-environment /opt/spack-environment
COPY --from=builder /opt/software /opt/software
COPY --from=builder /opt/view /opt/view
COPY --from=builder /etc/profile.d/z10_spack_environment.sh /etc/profile.d/z10_spack_environment.sh
ENTRYPOINT ["/bin/bash", "--rcfile", "/etc/profile", "-l"]