summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorOwen Solberg <odoublewen@users.noreply.github.com>2024-01-11 09:47:10 -0800
committerGitHub <noreply@github.com>2024-01-11 18:47:10 +0100
commit4022f083d5c2f770f83397729d6371b6012444a0 (patch)
treebe6b74fbd59bb5401871b4d70c1afe7bf0d3e08f /share
parent49307b6cb21107085ef55147a87f2a0f9f7aeb9a (diff)
downloadspack-4022f083d5c2f770f83397729d6371b6012444a0.tar.gz
spack-4022f083d5c2f770f83397729d6371b6012444a0.tar.bz2
spack-4022f083d5c2f770f83397729d6371b6012444a0.tar.xz
spack-4022f083d5c2f770f83397729d6371b6012444a0.zip
Containerize: accommodate nested or pre-existing spack-env paths (#41558)
The current `mkdir {{ paths.environment }}` will generate an error if: * `{{ paths.environment }}` already exists, or * `{{ paths.environment }}` is nested in non-existing dirs. Adding `-p` to the command will make this robust to both possibilities. Set noclobber bash option when writing manifest.
Diffstat (limited to 'share')
-rw-r--r--share/spack/templates/container/Dockerfile3
1 files changed, 2 insertions, 1 deletions
diff --git a/share/spack/templates/container/Dockerfile b/share/spack/templates/container/Dockerfile
index 2fad37affb..2f7aae901c 100644
--- a/share/spack/templates/container/Dockerfile
+++ b/share/spack/templates/container/Dockerfile
@@ -16,7 +16,8 @@ RUN {% if os_package_update %}{{ os_packages_build.update }} \
# What we want to install and how we want to install it
# is specified in a manifest file (spack.yaml)
-RUN mkdir {{ paths.environment }} \
+RUN mkdir -p {{ paths.environment }} && \
+set -o noclobber \
{{ manifest }} > {{ paths.environment }}/spack.yaml
# Install the software, remove unnecessary deps