Skip to content

Commit

Permalink
Merge branch 'master' into better_base
Browse files Browse the repository at this point in the history
  • Loading branch information
boegel committed May 28, 2020
2 parents 2589e33 + eb44877 commit 389c69f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion containers/Dockerfile.centos7-GCC-9.3.0
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
FROM easybuilders/base:centos7-eb4.2.1
# install software & accompanying modules
# CPU_ARCH is expected to be defined in the "docker build" command,
# for example: docker build --build-arg CPU_ARCH=haswell
ARG CPU_ARCH
# make sure CPU_ARCH is defined
RUN test -n "${CPU_ARCH}" || (echo "\$CPU_ARCH undefined, use 'docker build --build-arg CPU_ARCH=...'" && exit 1)
# verify provided CPU_ARCH value, should match with what archspec produces
RUN export HOST_CPU_ARCH=$(python3 -c 'import archspec.cpu; print(archspec.cpu.host())') && \
(test "${CPU_ARCH}" == "$HOST_CPU_ARCH" || (echo "Host CPU arch '${HOST_CPU_ARCH}' doesn't match specified CPU arch '${CPU_ARCH}'!" && exit 1))
# use $CPU_ARCH to define label and set it as environment variable (to use in subsequent builds
LABEL cpu_arch=${CPU_ARCH}
ENV CPU_ARCH=${CPU_ARCH}
# use /easybuild for everything that should persist in the container (software, modules and sources)
# everything else goes in /scratch, which will be cleaned out
RUN eb --prefix /scratch --installpath /easybuild GCC-9.3.0.eb --robot --trace \
Expand Down

0 comments on commit 389c69f

Please sign in to comment.