Skip to content

Instantly share code, notes, and snippets.

@nazavode
Last active October 24, 2019 08:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nazavode/7e6974d2c02394277ccd8e919b90ca26 to your computer and use it in GitHub Desktop.
Save nazavode/7e6974d2c02394277ccd8e919b90ca26 to your computer and use it in GitHub Desktop.
FROM ubuntu:18.04
LABEL name="spack-linux-ubuntu18.04-x86_64"
####################################################
# Spack Setup #
####################################################
ARG SPACK_GIT_URL=https://github.com/spack/spack.git
ARG SPACK_GIT_BRANCH=develop
ARG SPACK_GIT_HASH=af65146ef69fcde10d53b2ee12f82a9c28361e23
####################################################
ENV LANG C.UTF-8
RUN DEBIAN_FRONTEND=noninteractive \
apt-get clean &&\
apt-get update &&\
apt-get autoclean -y &&\
apt-get autoremove -y &&\
apt-get update &&\
# Install utilities
apt-get install -f -y apt-utils &&\
# Install spack requirements
apt-get install -f -y build-essential \
gfortran \
python \
git \
subversion \
curl \
wget \
unzip &&\
# Clean up all temporary files
apt-get clean &&\
apt-get autoclean -y &&\
apt-get autoremove -y &&\
apt-get clean &&\
rm -rf /tmp/* /var/tmp/* &&\
rm -rf /var/lib/apt/lists/* &&\
rm -f /etc/ssh/ssh_host_*
####################################################
ENV SPACK_ARCHIVE "${SPACK_GIT_HASH:-${SPACK_GIT_BRANCH}}"
RUN wget -P / "https://github.com/spack/spack/archive/${SPACK_ARCHIVE}.zip" &&\
unzip -q -d / "/${SPACK_ARCHIVE}.zip" &&\
mv "/spack-${SPACK_ARCHIVE}" /spack &&\
rm -f /${SPACK_ARCHIVE}.zip &&\
echo "${SPACK_ARCHIVE}" > /SPACKVERSION &&\
useradd -ms /bin/bash spacker &&\
chown -R spacker /spack
USER spacker
# LLVM
RUN /spack/bin/spack bootstrap &&\
/spack/bin/spack install llvm &&\
/spack/bin/spack clean --all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment