Dockerfile 6.93 KB
Newer Older
David Blyth's avatar
David Blyth committed
1 2 3 4 5 6 7 8 9
# Author: David Blyth
# Description: Docker build for producing a base for ANL EIC software efforts

FROM dbcooper/arch:2017-05-02

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
ENV ROOT_RELEASE=v6-10-06

David Blyth's avatar
David Blyth committed
25 26 27 28 29 30
RUN sudo pacman -S --noconfirm \
        awk \
        binutils \
        cmake \
        fftw \
        gcc \
31
        git \
David Blyth's avatar
David Blyth committed
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
        glew \
        glu \
        grep \
        gsl \
        gzip \
        libx11 \
        libxft \
        libxpm \
        make \
        python2 \
&&  sudo rm -rf /var/cache/pacman/pkg

RUN git clone https://github.com/root-project/root.git \
&&  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 \
        -Dcxx14=ON \
        -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 \
    ROOTSYS=/usr/local \
70
    MANPATH=/usr/local/man
David Blyth's avatar
David Blyth committed
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138

# CLHEP
ENV CLHEP_RELEASE=CLHEP_2_3_4_5

RUN git clone https://gitlab.cern.ch/CLHEP/CLHEP.git \
&&  cd CLHEP \
&&  git checkout tags/$CLHEP_RELEASE \
&&  mkdir build \
&&  cd build \
&&  CXXFLAGS=-std=c++14 cmake \
        -DCMAKE_INSTALL_PREFIX=/usr/local/ \
        -DCMAKE_BUILD_TYPE=Release \
        ../ \
&&  make -j $BUILD_THREADS \
&&  sudo make install \
&&  cd ../../ \
&&  rm -rf CLHEP

# GEANT4
ENV GEANT4_RELEASE=v10.3.3

RUN sudo pacman -S --noconfirm \
        xerces-c \
&&  sudo rm -rf /var/cache/pacman/pkg

RUN git clone https://github.com/Geant4/geant4.git \
&&  cd geant4 \
&&  git checkout tags/$GEANT4_RELEASE \
&&  mkdir build \
&&  cd build \
&&  cmake \
        -DCMAKE_INSTALL_PREFIX=/usr/local/ \
        -DCMAKE_BUILD_TYPE=Release \
        -DGEANT4_BUILD_CXXSTD=14 \
        -DGEANT4_INSTALL_DATA=ON \
        -DGEANT4_USE_GDML=ON \
        -DGEANT4_USE_SYSTEM_CLHEP=ON \
        ../ \
&&  make -j $BUILD_THREADS \
&&  sudo make install \
&&  cd ../../ \
&&  rm -rf geant4

ENV LD_LIBRARY_PATH=/usr/local/lib64:${LD_LIBRARY_PATH} \
    GEANT4_DATA_DIRECTORY=/usr/local/share/Geant4-10.3.3/data
ENV G4NEUTRONHPDATA=${GEANT4_DATA_DIRECTORY}/G4NDL4.5 \
    G4LEDATA=${GEANT4_DATA_DIRECTORY}/G4EMLOW6.50 \
    G4LEVELGAMMADATA=${GEANT4_DATA_DIRECTORY}/PhotonEvaporation4.3.2 \
    G4RADIOACTIVEDATA=${GEANT4_DATA_DIRECTORY}/RadioactiveDecay5.1.1 \
    G4NEUTRONXSDATA=${GEANT4_DATA_DIRECTORY}/G4NEUTRONXS1.4 \
    G4PIIDATA=${GEANT4_DATA_DIRECTORY}/G4PII1.3 \
    G4REALSURFACEDATA=${GEANT4_DATA_DIRECTORY}/RealSurface1.0 \
    G4SAIDXSDATA=${GEANT4_DATA_DIRECTORY}/G4SAIDDATA1.1 \
    G4ABLADATA=${GEANT4_DATA_DIRECTORY}/G4ABLA3.0 \
    G4ENSDFSTATEDATA=${GEANT4_DATA_DIRECTORY}/G4ENSDFSTATE2.1

# LCIO
ENV LCIO_RELEASE=v02-08

RUN git clone https://github.com/iLCSoft/LCIO.git \
&&  cd LCIO \
&&  git checkout tags/$LCIO_RELEASE \
&&  cd ../ \
&&  mkdir build \
&&  cd build \
&&  CXXFLAGS=-std=c++14 cmake \
        -DCMAKE_INSTALL_PREFIX=/usr/local \
        -DCMAKE_BUILD_TYPE=Release \
139
        -DBUILD_ROOTDICT=ON \
David Blyth's avatar
David Blyth committed
140 141 142 143 144 145
        ../LCIO \
&&  make -j $BUILD_THREADS \
&&  sudo make install \
&&  cd ../ \
&&  rm -rf build LCIO

146
ENV ROOT_INCLUDE_PATH=/usr/local:/usr/local/include
David Blyth's avatar
David Blyth committed
147 148

# DD4hep
149 150
ENV DD4HEP_CHECKOUT=88ef8dffd27d95233c92ccfe0b4e90467af284f8 \
    DD4HEP_REPO=https://github.com/decibelcooper/DD4hep.git
David Blyth's avatar
David Blyth committed
151 152

RUN sudo pacman -S --noconfirm \
153
        boost \
David Blyth's avatar
David Blyth committed
154 155
&&  sudo rm -rf /var/cache/pacman/pkg

156
RUN git clone $DD4HEP_REPO \
David Blyth's avatar
David Blyth committed
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186
&&  cd DD4hep \
&&  git checkout $DD4HEP_CHECKOUT \
&&  cd .. \
&&  mkdir build \
&&  cd build \
&&  cmake \
        -DBUILD_TESTING=ON \
        -DCMAKE_INSTALL_PREFIX=/usr/local \
        -DDD4HEP_USE_CXX14=ON \
        -DDD4HEP_USE_GEANT4=ON \
        -DDD4HEP_USE_LCIO=ON \
        -DDD4HEP_USE_PYROOT=ON \
        -DDD4HEP_USE_XERCESC=ON \
        ../DD4hep \
&&  make -j $BUILD_THREADS \
&&  sudo make install \
&&  cd .. \
&&  rm -rf build DD4hep

ENV DD4hepINSTALL=/usr/local \
    DD4hep_ROOT=/usr/local \
    DD4hep_DIR=/usr/local \
    PYTHONPATH=/usr/local/python:${PYTHONPATH}

# Protobuf
ENV PROTOBUF_RELEASE=v3.4.1

RUN sudo pacman -S --noconfirm \
        autoconf \
        automake \
187
        unzip \
David Blyth's avatar
David Blyth committed
188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213
&&  sudo rm -rf /var/cache/pacman/pkg

RUN git clone https://github.com/google/protobuf.git \
&&  cd protobuf \
&&  git checkout tags/$PROTOBUF_RELEASE \
&&  ./autogen.sh \
&&  ./configure \
        --prefix=/usr/local \
&&  make -j $BUILD_THREADS \
&&  sudo make install \
&&  cd ../ \
&&  rm -rf protobuf

# proio
ENV GOPATH=/opt/Go
ENV PROIO_CHECKOUT=bf369b61372e6139cb28a3ffeb46b7d7f1ba76b6 \
    PROIO_SOURCE=$GOPATH/src/github.com/decibelcooper/proio \
    PATH=$GOPATH/bin:${PATH}

RUN sudo pacman -S --noconfirm \
        go \
        python-pip \
        python2-pip \
&&  sudo rm -rf /var/cache/pacman/pkg

RUN sudo mkdir $GOPATH \
214
&&  sudo chown eicuser:eicuser $GOPATH \
David Blyth's avatar
David Blyth committed
215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233
&&  git clone https://github.com/decibelcooper/proio.git $PROIO_SOURCE \
&&  cd $PROIO_SOURCE \
&&  git checkout $PROIO_CHECKOUT \
&&  mkdir cpp-proio/build \
&&  cd cpp-proio/build \
&&  cmake \
        -DCMAKE_INSTALL_PREFIX=/usr/local \
        -DCMAKE_BUILD_TYPE=Release \
        ../ \
&&  make -j $BUILD_THREADS \
&&  sudo make install \
&&  cd ../../go-proio \
&&  go get ./... \
&&  cd ../py-proio \
&&  sudo pip install . \
&&  sudo pip2 install . \
&&  cd \
&&  rm -rf $GOPATH/src

234
# NPDet
235
ENV NPDET_CHECKOUT=b51fd85b1abcb54632aeaa9eb7c3d07b1ec8c4c3
236 237 238 239 240 241 242 243 244 245 246 247 248 249 250

RUN git clone https://eicweb.phy.anl.gov/EIC/NPDet.git \
&&  cd NPDet \
&&  git checkout $NPDET_CHECKOUT \
&&  mkdir build \
&&  cd build \
&&  cmake \
        -DCMAKE_INSTALL_PREFIX=/usr/local \
        -DCMAKE_BUILD_TYPE=Release \
        ../ \
&&  make -j $BUILD_THREADS \
&&  sudo make install \
&&  cd ../../ \
&&  rm -rf NPDet

251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273
# GenFit
ENV GENFIT_CHECKOUT=70c408ff7424bdfd572ddc175b9673e8a1e91bbb \
    GENFIT_PATH=/opt/GenFit

RUN sudo pacman -S --noconfirm \
        eigen \
&&  sudo rm -rf /var/cache/pacman/pkg

RUN git clone https://github.com/GenFit/GenFit.git $GENFIT_PATH \
&&  cd $GENFIT_PATH \
&&  git checkout $GENFIT_CHECKOUT \
&&  sed -i.bak 's/\(CPP_STANDARD\) c++11/\1 c++14/' CMakeLists.txt \
&&  mkdir build \
&&  cd build \
&&  cmake \
        -DCMAKE_INSTALL_PREFIX=/usr/local \
        -DCMAKE_BUILD_TYPE=Release \
        ../ \
&&  make -j $BUILD_THREADS \
&&  make install \
&&  cd ../ \
&&  rm -rf build

David Blyth's avatar
David Blyth committed
274 275
# Convenience tools
RUN sudo pacman -S --noconfirm \
276 277
        ipython \
        ipython2 \
278
        mesa-demos \
David Blyth's avatar
David Blyth committed
279 280
        openssh \
        procps-ng \
281
        tigervnc \
David Blyth's avatar
David Blyth committed
282
        vim \
283
        wget \
284
        which \
285
        xfce4 \
David Blyth's avatar
David Blyth committed
286 287
&&  sudo rm -rf /var/cache/pacman/pkg