summaryrefslogtreecommitdiff
path: root/share/spack/docker/centos-7.dockerfile
diff options
context:
space:
mode:
Diffstat (limited to 'share/spack/docker/centos-7.dockerfile')
-rw-r--r--share/spack/docker/centos-7.dockerfile74
1 files changed, 35 insertions, 39 deletions
diff --git a/share/spack/docker/centos-7.dockerfile b/share/spack/docker/centos-7.dockerfile
index 6aa969fef8..67affa1af9 100644
--- a/share/spack/docker/centos-7.dockerfile
+++ b/share/spack/docker/centos-7.dockerfile
@@ -16,46 +16,42 @@ COPY share $SPACK_ROOT/share
COPY var $SPACK_ROOT/var
RUN mkdir -p $SPACK_ROOT/opt/spack
-RUN yum update -y \
- && yum install -y epel-release \
- && yum update -y \
+RUN ln -s $SPACK_ROOT/share/spack/docker/entrypoint.bash \
+ /usr/local/bin/docker-shell \
+ && ln -s $SPACK_ROOT/share/spack/docker/entrypoint.bash \
+ /usr/local/bin/interactive-shell \
+ && ln -s $SPACK_ROOT/share/spack/docker/entrypoint.bash \
+ /usr/local/bin/spack-env
+
+RUN yum update -y \
+ && yum install -y epel-release \
+ && yum update -y \
&& yum --enablerepo epel groupinstall -y "Development Tools" \
- && yum --enablerepo epel install -y \
- curl findutils gcc-c++ gcc \
- gcc-gfortran git gnupg2 hostname \
- iproute Lmod make patch \
- openssh-server python python-pip tcl \
- unzip which \
- && pip install boto3 \
- && rm -rf /var/cache/yum \
+ && yum --enablerepo epel install -y \
+ curl \
+ findutils \
+ gcc-c++ \
+ gcc \
+ gcc-gfortran \
+ git \
+ gnupg2 \
+ hostname \
+ iproute \
+ Lmod \
+ make \
+ patch \
+ python \
+ python-pip \
+ tcl \
+ unzip \
+ which \
+ && pip install boto3 \
+ && rm -rf /var/cache/yum \
&& yum clean all
-RUN ( echo ". /usr/share/lmod/lmod/init/bash" \
- && echo ". \$SPACK_ROOT/share/spack/setup-env.sh" \
- && echo "if [ \"\$CURRENTLY_BUILDING_DOCKER_IMAGE\" '!=' '1' ]" \
- && echo "then" \
- && echo " . \$SPACK_ROOT/share/spack/spack-completion.bash" \
- && echo "fi" ) \
- >> /etc/profile.d/spack.sh \
- && ( echo "f=\"\$SPACK_ROOT/share/spack/docker/handle-ssh.sh\"" \
- && echo "if [ -f \"\$f\" ]" \
- && echo "then" \
- && echo " . \"\$f\"" \
- && echo "else" \
- && cat $SPACK_ROOT/share/spack/docker/handle-ssh.sh \
- && echo "fi" ) \
- >> /etc/profile.d/handle-ssh.sh \
- && ( echo "f=\"\$SPACK_ROOT/share/spack/docker/handle-prompt.sh\"" \
- && echo "if [ -f \"\$f\" ]" \
- && echo "then" \
- && echo " . \"\$f\"" \
- && echo "else" \
- && cat $SPACK_ROOT/share/spack/docker/handle-prompt.sh \
- && echo "fi" ) \
- >> /etc/profile.d/handle-prompt.sh \
- && mkdir -p /root/.spack \
- && cp $SPACK_ROOT/share/spack/docker/modules.yaml \
- /root/.spack/modules.yaml \
+RUN mkdir -p /root/.spack \
+ && cp $SPACK_ROOT/share/spack/docker/modules.yaml \
+ /root/.spack/modules.yaml \
&& rm -rf /root/*.* /run/nologin $SPACK_ROOT/.git
# [WORKAROUND]
@@ -66,10 +62,10 @@ RUN [ -f ~/.profile ] \
|| true
WORKDIR /root
-SHELL ["/bin/bash", "-l", "-c"]
+SHELL ["docker-shell"]
# TODO: add a command to Spack that (re)creates the package cache
RUN spack spec hdf5+mpi
ENTRYPOINT ["/bin/bash", "/opt/spack/share/spack/docker/entrypoint.bash"]
-CMD ["docker-shell"]
+CMD ["interactive-shell"]