Skip to content

Commit b209d43

Browse files
authored
Dockerfile.base-spack: check if $SPACK_CONFIG_DIR exists (#144)
This change will generate an ENOENT error, if the spack-config directory for a particular Spack version does not exist.
1 parent faa0b55 commit b209d43

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

containers/Dockerfile.base-spack

+3-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ RUN git clone https://github.com/ACCESS-NRI/spack-packages.git ${SPACK_PACKAGES
8888
# Install ACCESS-NRI's spack-config repo
8989
RUN git clone https://github.com/ACCESS-NRI/spack-config.git ${SPACK_CONFIG_REPO_ROOT} --branch ${SPACK_CONFIG_REPO_VERSION}
9090

91-
RUN ln -s -r -v ${SPACK_CONFIG_DIR}/* ${SPACK_ROOT}/etc/spack/
91+
# Exit with ENOENT 2 "No such file or directory", if the directory does not
92+
# exist
93+
RUN if [ -d "${SPACK_CONFIG_DIR}" ]; then ln -s -r -v ${SPACK_CONFIG_DIR}/* ${SPACK_ROOT}/etc/spack/; else echo "${SPACK_CONFIG_DIR} does not exist!"; exit 2; fi
9294

9395
# Enables setting Spack setup type via SHELL command
9496
# docker-shell: Use for build RUN steps

0 commit comments

Comments
 (0)