summaryrefslogtreecommitdiff
path: root/share/spack/templates/container/Dockerfile
diff options
context:
space:
mode:
Diffstat (limited to 'share/spack/templates/container/Dockerfile')
-rw-r--r--share/spack/templates/container/Dockerfile8
1 files changed, 5 insertions, 3 deletions
diff --git a/share/spack/templates/container/Dockerfile b/share/spack/templates/container/Dockerfile
index 92e89668e0..27c2dbf5cf 100644
--- a/share/spack/templates/container/Dockerfile
+++ b/share/spack/templates/container/Dockerfile
@@ -51,15 +51,17 @@ FROM {{ run.image }}
COPY --from=builder {{ paths.environment }} {{ paths.environment }}
COPY --from=builder {{ paths.store }} {{ paths.store }}
-COPY --from=builder {{ paths.hidden_view }} {{ paths.hidden_view }}
-COPY --from=builder {{ paths.view }} {{ paths.view }}
+
+# paths.view is a symlink, so copy the parent to avoid dereferencing and duplicating it
+COPY --from=builder {{ paths.view_parent }} {{ paths.view_parent }}
RUN { \
echo '#!/bin/sh' \
&& echo '.' {{ paths.environment }}/activate.sh \
&& echo 'exec "$@"'; \
} > /entrypoint.sh \
-&& chmod a+x /entrypoint.sh
+&& chmod a+x /entrypoint.sh \
+&& ln -s {{ paths.view }} {{ paths.former_view }}
{% block final_stage %}