Skip to content

Commit e4bb85c

Browse files
kniecChristian Kniep
andauthored
Add amazonlinux (x86/arm) dockerfile (spack#20320)
Co-authored-by: Christian Kniep <kniec@amazon.com>
1 parent ea7d14a commit e4bb85c

File tree

1 file changed

+70
-0
lines changed

1 file changed

+70
-0
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
FROM public.ecr.aws/amazonlinux/amazonlinux:2.0.20201111.0
2+
MAINTAINER Spack Maintainers <maintainers@spack.io>
3+
4+
ENV DOCKERFILE_BASE=centos \
5+
DOCKERFILE_DISTRO=centos \
6+
DOCKERFILE_DISTRO_VERSION=7 \
7+
SPACK_ROOT=/opt/spack \
8+
DEBIAN_FRONTEND=noninteractive \
9+
CURRENTLY_BUILDING_DOCKER_IMAGE=1 \
10+
container=docker
11+
12+
RUN yum update -y \
13+
&& yum groupinstall -y "Development Tools" \
14+
&& yum install -y \
15+
curl \
16+
findutils \
17+
gcc-c++ \
18+
gcc \
19+
gcc-gfortran \
20+
git \
21+
gnupg2 \
22+
hostname \
23+
iproute \
24+
Lmod \
25+
make \
26+
patch \
27+
python \
28+
python-pip \
29+
python-setuptools \
30+
tcl \
31+
unzip \
32+
which \
33+
&& pip install boto3 \
34+
&& rm -rf /var/cache/yum \
35+
&& yum clean all
36+
37+
COPY bin $SPACK_ROOT/bin
38+
COPY etc $SPACK_ROOT/etc
39+
COPY lib $SPACK_ROOT/lib
40+
COPY share $SPACK_ROOT/share
41+
COPY var $SPACK_ROOT/var
42+
RUN mkdir -p $SPACK_ROOT/opt/spack
43+
44+
RUN ln -s $SPACK_ROOT/share/spack/docker/entrypoint.bash \
45+
/usr/local/bin/docker-shell \
46+
&& ln -s $SPACK_ROOT/share/spack/docker/entrypoint.bash \
47+
/usr/local/bin/interactive-shell \
48+
&& ln -s $SPACK_ROOT/share/spack/docker/entrypoint.bash \
49+
/usr/local/bin/spack-env
50+
51+
RUN mkdir -p /root/.spack \
52+
&& cp $SPACK_ROOT/share/spack/docker/modules.yaml \
53+
/root/.spack/modules.yaml \
54+
&& rm -rf /root/*.* /run/nologin $SPACK_ROOT/.git
55+
56+
# [WORKAROUND]
57+
# https://superuser.com/questions/1241548/
58+
# xubuntu-16-04-ttyname-failed-inappropriate-ioctl-for-device#1253889
59+
RUN [ -f ~/.profile ] \
60+
&& sed -i 's/mesg n/( tty -s \\&\\& mesg n || true )/g' ~/.profile \
61+
|| true
62+
63+
WORKDIR /root
64+
SHELL ["docker-shell"]
65+
66+
# TODO: add a command to Spack that (re)creates the package cache
67+
RUN spack spec hdf5+mpi
68+
69+
ENTRYPOINT ["/bin/bash", "/opt/spack/share/spack/docker/entrypoint.bash"]
70+
CMD ["interactive-shell"]

0 commit comments

Comments
 (0)