diff options
Diffstat (limited to 'share/spack/docker/Dockerfile')
-rw-r--r-- | share/spack/docker/Dockerfile | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/share/spack/docker/Dockerfile b/share/spack/docker/Dockerfile index 0c3b49f366..0a4eebe183 100644 --- a/share/spack/docker/Dockerfile +++ b/share/spack/docker/Dockerfile @@ -13,6 +13,7 @@ ENV DOCKERFILE_BASE=$BASE \ SPACK_ROOT=/spack \ FORCE_UNSAFE_CONFIGURE=1 \ DEBIAN_FRONTEND=noninteractive \ + CURRENTLY_BUILDING_DOCKER_IMAGE=1 \ container=docker COPY bin $SPACK_ROOT/bin @@ -110,7 +111,10 @@ RUN rm -rf $SPACK_ROOT/.git \ && pip install boto3 \ && ( echo ". /usr/share/lmod/lmod/init/bash" \ && echo ". $SPACK_ROOT/share/spack/setup-env.sh" \ - && echo ". $SPACK_ROOT/share/spack/spack-completion.bash" ) \ + && echo "if [ \"\$CURRENTLY_BUILDING_DOCKER_IMAGE\" '!=' '1' ]" \ + && echo "then" \ + && echo " . $SPACK_ROOT/share/spack/spack-completion.bash" \ + && echo "fi" ) \ >> /etc/profile.d/spack.sh \ && ln -s $SPACK_ROOT/share/spack/docker/handle-ssh.sh \ /etc/profile.d/handle-ssh.sh \ @@ -126,7 +130,15 @@ MASK [[ $DISTRO_VERSION =~ (centos|fedora|opensuse|rhel.*) ]] RUN rm -f /run/nologin MASK POP +# [WORKAROUND] +# https://superuser.com/questions/1241548/ +# xubuntu-16-04-ttyname-failed-inappropriate-ioctl-for-device#1253889 +RUN [ -f ~/.profile ] \ + && sed -i 's/mesg n/( tty -s \\&\\& mesg n || true )/g' ~/.profile \ + || true + WORKDIR /root -ENTRYPOINT ["bash", "/spack/share/spack/docker/entrypoint.bash"] +SHELL ["/bin/bash", "-l", "-c"] +ENTRYPOINT ["/bin/bash", "/spack/share/spack/docker/entrypoint.bash"] CMD ["docker-shell"] |