Skip to content

Commit ebf0548

Browse files
committed
create /.bashrc for intended restart behavior
1 parent 769f05f commit ebf0548

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
@@ -66,13 +66,19 @@ RUN cd /opt/spack-environment \
6666
RUN cd /opt/spack-environment && \
6767
spack env activate --sh -d . > activate.sh
6868

69-
# Set entry point
70-
RUN { \
71-
echo '#!/bin/sh' \
72-
&& echo '.' /opt/spack-environment/activate.sh \
73-
&& echo export OMPI_ALLOW_RUN_AS_ROOT=1 \
74-
&& echo export OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 \
75-
&& echo 'exec "$@"'; \
69+
# Make .bashrc root profile (used on container restarts)
70+
# and add container entry point
71+
RUN mkdir -p /root \
72+
&& { \
73+
echo "export OMPI_ALLOW_RUN_AS_ROOT=1"; \
74+
echo "export OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1"; \
75+
echo ". /opt/spack/share/spack/setup-env.sh"; \
76+
echo ". /opt/spack-environment/activate.sh"; \
77+
} > /root/.bashrc \
78+
&& { \
79+
echo '#!/bin/sh'; \
80+
echo ". /root/.bashrc"; \
81+
echo 'exec "$@"'; \
7682
} > /entrypoint.sh \
7783
&& chmod a+x /entrypoint.sh \
7884
&& ln -s /opt/views/view /opt/view

0 commit comments

Comments
 (0)