summaryrefslogtreecommitdiff
path: root/share/spack/docs/docker/module-file-tutorial/Dockerfile
blob: a012492a98042a1384a822c48dec1d29979e1b8b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
FROM ubuntu:16.04

# General environment for docker
ENV DEBIAN_FRONTEND=noninteractive \
    SPACK_ROOT=/usr/local \
    FORCE_UNSAFE_CONFIGURE=1

# Install system packages
RUN apt-get update \
    && apt-get install -y --no-install-recommends \
       autoconf \
       build-essential \
       ca-certificates \
       coreutils \
       curl man less \
       emacs-nox vim nano \
       git \
       openmpi-bin openmpi-common libopenmpi-dev \
       python \
       unzip \
    &&  rm -rf /var/lib/apt/lists/*      

# Load spack environment on login
COPY spack.sh /etc/profile

# Install spack
RUN curl -s -L https://api.github.com/repos/spack/spack/tarball/develop \
    | tar xzC $SPACK_ROOT --strip 1 

# Copy configuration for external packages
COPY packages.yaml $SPACK_ROOT/etc/spack/

# Build lmod
RUN spack install lmod && spack clean -a 

# Build a compiler
RUN spack install gcc@7.2.0 && spack clean -a
RUN /bin/bash -l -c ' \
    spack load gcc@7.2.0 \
    && spack compiler add'

# Build the software on top of the compiler
RUN spack install netlib-scalapack ^openmpi ^openblas %gcc@7.2.0 \
    && spack install netlib-scalapack ^mpich ^openblas %gcc@7.2.0 \
    && spack install netlib-scalapack ^openmpi ^netlib-lapack %gcc@7.2.0 \
    && spack install netlib-scalapack ^mpich ^netlib-lapack %gcc@7.2.0 \
    && spack install py-scipy ^openblas \
    && spack clean -a

# image run hook: the -l will make sure /etc/profile environments are loaded
CMD /bin/bash -l