Skip to content

Commit 95c8d5c

Browse files
committed
create /.bashrc for intended restart behavior
1 parent 668787c commit 95c8d5c

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

docker/ubuntu

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,19 @@ RUN . /opt/spack-environment/activate.sh && \
8383
cmake --install build && \
8484
echo 'export PATH="/opt/3DThesis/bin:$PATH"' >> /opt/spack-environment/activate.sh
8585

86-
# Set entry point
87-
RUN { \
88-
echo '#!/bin/sh' \
89-
&& echo '.' /opt/spack-environment/activate.sh \
90-
&& echo export OMPI_ALLOW_RUN_AS_ROOT=1 \
91-
&& echo export OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 \
92-
&& echo 'exec "$@"'; \
86+
# Make .bashrc root profile (used on container restarts)
87+
# and add container entry point
88+
RUN mkdir -p /root \
89+
&& { \
90+
echo "export OMPI_ALLOW_RUN_AS_ROOT=1"; \
91+
echo "export OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1"; \
92+
echo ". /opt/spack/share/spack/setup-env.sh"; \
93+
echo ". /opt/spack-environment/activate.sh"; \
94+
} > /root/.bashrc \
95+
&& { \
96+
echo '#!/bin/sh'; \
97+
echo ". /root/.bashrc"; \
98+
echo 'exec "$@"'; \
9399
} > /entrypoint.sh \
94100
&& chmod a+x /entrypoint.sh \
95101
&& ln -s /opt/views/view /opt/view

0 commit comments

Comments
 (0)