Commit 7e030ff0 authored by David Blyth's avatar David Blyth

Initial commit

parents
# 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 \
sed \
sudo \
&& rm -rf /var/cache/pacman/pkg
RUN useradd -m -G wheel evochainuser \
&& sed -i.bak 's/# \(%wheel ALL=(ALL) NOPASSWD: ALL\)/\1/' /etc/sudoers
USER evochainuser
WORKDIR /home/evochainuser
CMD /bin/bash
# ROOT
RUN sudo pacman -S --noconfirm \
awk \
binutils \
cmake \
fftw \
gcc \
git \
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 \
-DBUILD_ROOTDICT=ON \
../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 \
boost \
&& 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 \
unzip \
&& 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 \
&& sudo chown evochainuser:evochainuser $GOPATH \
&& 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
# About
This repository contains a Dockerfile for building a base container image for a
variety of uses in the context of EIC studies at ANL.
# Using the image
## Docker
```shell
docker run -it argonneeic/base
```
See Docker documentation for more command line options.
## Singularity
```shell
singularity pull docker://argonneeic/base
./base.img
```
# Building the image
Example:
```shell
docker build -t baseimg --build-args BUILD_THREADS=10 .
```
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment