Dockerfile 6.7 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 \
David Blyth's avatar
David Blyth committed
15 16
&&  sed -i.bak 's/# \(%wheel ALL=(ALL) NOPASSWD: ALL\)/\1/' /etc/sudoers

17 18
USER eicuser
WORKDIR /home/eicuser
David Blyth's avatar
David Blyth committed
19 20 21 22 23 24 25 26 27 28

CMD /bin/bash

# ROOT
RUN sudo pacman -S --noconfirm \
        awk \
        binutils \
        cmake \
        fftw \
        gcc \
29
        git \
David Blyth's avatar
David Blyth committed
30 31 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 70 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 139
        glew \
        glu \
        grep \
        gsl \
        gzip \
        libx11 \
        libxft \
        libxpm \
        make \
        python2 \
&&  sudo rm -rf /var/cache/pacman/pkg

ENV ROOT_RELEASE=v6-10-06

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 \
    MANPATH=/usr/local/man \
    CMAKE_PREFIX_PATH=/usr/local

# 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 \
140
        -DBUILD_ROOTDICT=ON \
David Blyth's avatar
David Blyth committed
141 142 143 144 145 146 147 148 149 150 151 152 153 154
        ../LCIO \
&&  make -j $BUILD_THREADS \
&&  sudo make install \
&&  cd ../ \
&&  rm -rf build LCIO

ENV ROOT_INCLUDE_PATH=/usr/local/include

# DD4hep
#ENV DD4HEP_RELEASE=v01-03
ENV DD4HEP_URL=https://github.com/decibelcooper/DD4hep.git \
    DD4HEP_CHECKOUT=185b944c627fb66dc0d2f23d9551c0e5563b59ac

RUN sudo pacman -S --noconfirm \
155
        boost \
David Blyth's avatar
David Blyth committed
156 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 187 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 214 215 216 217 218 219 220 221 222 223 224
&&  sudo rm -rf /var/cache/pacman/pkg

RUN git clone $DD4HEP_URL \
&&  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}

# lcgeo
ENV LCGEO_RELEASE=v00-14

RUN git clone https://github.com/iLCSoft/lcgeo.git \
&&  cd lcgeo \
&&  git checkout tags/$LCGEO_RELEASE \
&&  sed -i 's/^\(#!.*python\>\)/\12/' $(find -type f) \
&&  mkdir build \
&&  cd build \
&&  CXXFLAGS=-std=c++14 cmake \
        -DCMAKE_INSTALL_PREFIX=/usr/local \
        ../ \
&&  make -j $BUILD_THREADS \
&&  sudo make install \
&&  cd ../../ \
&&  rm -rf lcgeo

ENV PYTHONPATH=/usr/local/lib/python:${PYTHONPATH}

# iLCUtil
ENV ILCUTIL_RELEASE=v01-04

RUN git clone https://github.com/iLCSoft/iLCUtil.git \
&&  cd iLCUtil \
&&  git checkout tags/$ILCUTIL_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 iLCUtil

# Protobuf
ENV PROTOBUF_RELEASE=v3.4.1

RUN sudo pacman -S --noconfirm \
        autoconf \
        automake \
225
        unzip \
David Blyth's avatar
David Blyth committed
226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251
&&  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 \
252
&&  sudo chown eicuser:eicuser $GOPATH \
David Blyth's avatar
David Blyth committed
253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278
&&  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

# Convenience tools
RUN sudo pacman -S --noconfirm \
        openssh \
        procps-ng \
        vim \
&&  sudo rm -rf /var/cache/pacman/pkg