ARG & ENV scoping fix in Dockerfile

This commit is contained in:
Richard Morrison 2022-07-17 21:11:17 +01:00
parent bf6cf505cc
commit a42ce82396
No known key found for this signature in database
GPG key ID: B99712FB2A966522

View file

@ -27,10 +27,6 @@ ARG compile_cores=1
# Set default value of HOME to /root
ENV HOME=/root
# OpenMC variables
ARG openmc_branch=master
ENV OPENMC_REPO='https://github.com/openmc-dev/openmc'
# Embree variables
ENV EMBREE_TAG='v3.12.2'
ENV EMBREE_REPO='https://github.com/embree/embree'
@ -174,6 +170,17 @@ RUN if [ "$build_libmesh" = "on" ]; then \
FROM dependencies AS build
ENV HOME=/root
ARG openmc_branch=master
ENV OPENMC_REPO='https://github.com/openmc-dev/openmc'
ARG build_dagmc
ARG build_libmesh
ENV DAGMC_INSTALL_DIR=$HOME/DAGMC/
ENV LIBMESH_INSTALL_DIR=$HOME/LIBMESH
# clone and install openmc
RUN mkdir -p ${HOME}/OpenMC && cd ${HOME}/OpenMC \
&& git clone --shallow-submodules --recurse-submodules --single-branch -b ${openmc_branch} --depth=1 ${OPENMC_REPO} \
@ -211,5 +218,7 @@ RUN mkdir -p ${HOME}/OpenMC && cd ${HOME}/OpenMC \
FROM build AS release
ENV HOME=/root
# Download cross sections (NNDC and WMP) and ENDF data needed by test suite
RUN ${HOME}/OpenMC/openmc/tools/ci/download-xs.sh