summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorChristian Kniep <53055915+kniec@users.noreply.github.com>2020-12-11 11:11:33 +0100
committerGitHub <noreply@github.com>2020-12-11 11:11:33 +0100
commite4bb85cd272c7ca2a7984a7553ae22a51d08919d (patch)
tree5853c5611daa484f7c87c70f66f9f566f861d12b /share
parentea7d14af108b8ee7a58b7adc6b4a6d6e18d957fa (diff)
downloadspack-e4bb85cd272c7ca2a7984a7553ae22a51d08919d.tar.gz
spack-e4bb85cd272c7ca2a7984a7553ae22a51d08919d.tar.bz2
spack-e4bb85cd272c7ca2a7984a7553ae22a51d08919d.tar.xz
spack-e4bb85cd272c7ca2a7984a7553ae22a51d08919d.zip
Add amazonlinux (x86/arm) dockerfile (#20320)
Co-authored-by: Christian Kniep <kniec@amazon.com>
Diffstat (limited to 'share')
-rw-r--r--share/spack/docker/amazonlinux-2.dockerfile70
1 files changed, 70 insertions, 0 deletions
diff --git a/share/spack/docker/amazonlinux-2.dockerfile b/share/spack/docker/amazonlinux-2.dockerfile
new file mode 100644
index 0000000000..70a99388a2
--- /dev/null
+++ b/share/spack/docker/amazonlinux-2.dockerfile
@@ -0,0 +1,70 @@
+FROM public.ecr.aws/amazonlinux/amazonlinux:2.0.20201111.0
+MAINTAINER Spack Maintainers <maintainers@spack.io>
+
+ENV DOCKERFILE_BASE=centos \
+ DOCKERFILE_DISTRO=centos \
+ DOCKERFILE_DISTRO_VERSION=7 \
+ SPACK_ROOT=/opt/spack \
+ DEBIAN_FRONTEND=noninteractive \
+ CURRENTLY_BUILDING_DOCKER_IMAGE=1 \
+ container=docker
+
+RUN yum update -y \
+ && yum groupinstall -y "Development Tools" \
+ && yum install -y \
+ curl \
+ findutils \
+ gcc-c++ \
+ gcc \
+ gcc-gfortran \
+ git \
+ gnupg2 \
+ hostname \
+ iproute \
+ Lmod \
+ make \
+ patch \
+ python \
+ python-pip \
+ python-setuptools \
+ tcl \
+ unzip \
+ which \
+ && pip install boto3 \
+ && rm -rf /var/cache/yum \
+ && yum clean all
+
+COPY bin $SPACK_ROOT/bin
+COPY etc $SPACK_ROOT/etc
+COPY lib $SPACK_ROOT/lib
+COPY share $SPACK_ROOT/share
+COPY var $SPACK_ROOT/var
+RUN mkdir -p $SPACK_ROOT/opt/spack
+
+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 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]
+# 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
+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 ["interactive-shell"]