Dockerfile 3.18 KB
Newer Older
David Blyth's avatar
David Blyth committed
1 2 3
# Author: David Blyth
# Description: Docker build for producing a base for ANL EIC software efforts

David Blyth's avatar
David Blyth committed
4
FROM dbcooper/arch:2018-09-05
David Blyth's avatar
David Blyth committed
5 6 7 8 9

ARG BUILD_THREADS=5

# Set up basic environment
RUN pacman -S --noconfirm \
10 11
        sed \
        sudo \
David Blyth's avatar
David Blyth committed
12 13
&&  rm -rf /var/cache/pacman/pkg

14
RUN useradd -m -G wheel eicuser \
15
&&  sed -i.bak 's/\s*#\s*\(%wheel\s*ALL=(ALL)\s*NOPASSWD:\s*ALL\)/\1/' /etc/sudoers
David Blyth's avatar
David Blyth committed
16

17 18
USER eicuser
WORKDIR /home/eicuser
David Blyth's avatar
David Blyth committed
19 20 21 22

CMD /bin/bash

# ROOT
23 24 25
ENV ROOT_RELEASE=v6-12-06 \
    CC=/usr/bin/clang \
    CXX=/usr/bin/clang++
26

David Blyth's avatar
David Blyth committed
27 28 29
RUN sudo pacman -S --noconfirm \
        awk \
        binutils \
30
        clang \
David Blyth's avatar
David Blyth committed
31 32
        cmake \
        fftw \
33
        git \
David Blyth's avatar
David Blyth committed
34 35 36 37 38 39 40 41 42 43 44 45
        glew \
        glu \
        grep \
        gsl \
        gzip \
        libx11 \
        libxft \
        libxpm \
        make \
        python2 \
&&  sudo rm -rf /var/cache/pacman/pkg

46
RUN git clone http://root.cern.ch/git/root.git \
David Blyth's avatar
David Blyth committed
47 48 49 50 51 52 53 54 55
&&  cd root \
&&  git checkout tags/$ROOT_RELEASE \
&&  cd .. \
&&  mkdir build \
&&  cd build \
&&  cmake \
        -DCMAKE_INSTALL_PREFIX=/usr/local \
        -DCMAKE_BUILD_TYPE=Release \
        -Dbuiltin_glew=OFF \
56
        -Dbuildtin_llvm=OFF \
David Blyth's avatar
David Blyth committed
57 58 59 60 61 62 63 64 65 66 67 68 69 70
        -Dgdml=ON \
        -Dgsl_shared=ON \
        -Dmathmore=ON \
        -Dminuit2=ON \
        -Dopengl=ON \
        ../root \
&&  make -j $BUILD_THREADS \
&&  sudo make install \
&&  cd .. \
&&  rm -rf build root

ENV PATH=/usr/local/bin:${PATH} \
    LD_LIBRARY_PATH=/usr/local/lib \
    PYTHONPATH=/usr/local/lib \
71
    ROOTSYS=/usr/local
David Blyth's avatar
David Blyth committed
72 73 74

# Protobuf
RUN sudo pacman -S --noconfirm \
75 76 77 78
        protobuf \
        protobuf-c \
        python-protobuf \
        python2-protobuf \
David Blyth's avatar
David Blyth committed
79 80
&&  sudo rm -rf /var/cache/pacman/pkg

81
# lz4
David Blyth's avatar
David Blyth committed
82
ENV LZ4_RELEASE=v1.8.1.2
83 84 85 86 87 88 89 90 91

RUN git clone https://github.com/lz4/lz4.git \
&&  cd lz4 \
&&  git checkout tags/$LZ4_RELEASE \
&&  make -j $BUILD_THREADS \
&&  sudo make install \
&&  cd ../ \
&&  rm -rf lz4

92
# go-proio
David Blyth's avatar
David Blyth committed
93
ENV GOPATH=/opt/Go
94
ENV GO_PROIO_CHECKOUT=v0.3.0 \
David Blyth's avatar
David Blyth committed
95 96 97 98
    PATH=$GOPATH/bin:${PATH}

RUN sudo pacman -S --noconfirm \
        go \
99 100
&&  sudo rm -rf /var/cache/pacman/pkg

101 102
RUN git clone https://github.com/proio-org/go-proio.git \
&&  cd go-proio \
103 104
&&  git checkout $GO_PROIO_CHECKOUT \
&&  go get ./... \
105 106
&&  cd .. \
&&  sudo rm -rf go-proio $GOPATH/src $GOPATH/pkg
107 108

# py-proio
David Blyth's avatar
David Blyth committed
109
ENV PY_PROIO_VERSION=0.12.52
110 111

RUN sudo pacman -S --noconfirm \
David Blyth's avatar
David Blyth committed
112 113 114 115
        python-pip \
        python2-pip \
&&  sudo rm -rf /var/cache/pacman/pkg

116 117 118 119
RUN sudo pip install proio==$PY_PROIO_VERSION \
&&  sudo pip2 install proio==$PY_PROIO_VERSION

# cpp-proio
120
ENV CPP_PROIO_CHECKOUT=v0.9.0
121 122

RUN git clone https://github.com/proio-org/cpp-proio.git \
David Blyth's avatar
David Blyth committed
123 124
&&  mkdir cpp-proio/build \
&&  cd cpp-proio/build \
125 126 127 128
&&  git checkout $CPP_PROIO_CHECKOUT \
&&  git submodule init \
&&  git submodule update \
&&  cmake ../ \
David Blyth's avatar
David Blyth committed
129 130
&&  make -j $BUILD_THREADS \
&&  sudo make install \
131 132
&&  cd ../../ \
&&  rm -rf cpp-proio
David Blyth's avatar
David Blyth committed
133 134 135

# Convenience tools
RUN sudo pacman -S --noconfirm \
136
        emacs \
David Blyth's avatar
David Blyth committed
137
        gdb \
138
        mesa-demos \
139 140
        ipython \
        ipython2 \
141 142 143
        man-db \
        man-pages \
        nano \
David Blyth's avatar
David Blyth committed
144 145
        openssh \
        procps-ng \
146
        vi \
David Blyth's avatar
David Blyth committed
147
        vim \
148
        wget \
149
        which \
150
        xorg-server-xvfb \
David Blyth's avatar
David Blyth committed
151 152
&&  sudo rm -rf /var/cache/pacman/pkg

153 154
# Image ingredients
ADD . /image/eic-base