# Use SL6 as a base FROM sl:6 MAINTAINER Rebecca Lane "rebecca.lane@qmul.ac.uk" ### Run the following commands as super user (root): USER root # Install whole bunch of needed packages - some explicitly listed in RAT install instructions, some dependencies for ROOT, one for G4 RUN yum install -y \ vim \ emacs \ valgrid \ gdb \ which \ wget \ git \ gcc-c++ \ gcc \ python-devel \ python-argparse \ uuid-devel \ tar \ fftw \ fftw-devel \ gsl \ gsl-devel \ curl \ curl-devel \ bzip2 \ bzip2-devel \ libX11-devel \ libXpm-devel \ libXft-devel \ libXext-devel \ mesa-libGL-devel \ mesa-libGLU-devel \ libXmu-devel \ libXi-devel \ expat-devel \ && yum clean all \ && rm -rf /var/cache/yum ARG KEY ENV KEY $KEY # Copy over private key. Using deploykey with readonly access. RUN mkdir -p /root/.ssh RUN echo "$KEY" >> /root/.ssh/id_rsa RUN chmod 700 /root/.ssh/id_rsa # Create known_hosts RUN touch /root/.ssh/known_hosts # Add github host key into known_hosts RUN ssh-keyscan github.com >> /root/.ssh/known_hosts #Install cmake RUN cd /root \ && wget http://www.cmake.org/files/v2.8/cmake-2.8.12.tar.gz \ && tar -xvzf cmake-2.8.12.tar.gz \ && cd cmake-2.8.12 \ && ./bootstrap \ && make \ && make install \ && rm -rf cmake-2.8.12.tar.gz #Install root v5.34.36 #NOTE: may need to change to cmake build method, but below still works for 5.34.36 RUN cd /root \ && rm -rf root* \ && wget https://root.cern.ch/download/root_v5.34.36.source.tar.gz \ && mkdir root-5.34.36 \ && tar -xvzf root_v5.34.36.source.tar.gz -C root-5.34.36 --strip-components 1 \ && cd root-5.34.36 \ && ./configure --enable-minuit2 --enable-python --enable-mathmore \ && make \ && cd /root \ && rm -rf root_v5.34.36.source.tar.gz #Install Geant 4 10.00.p02 RUN cd /root \ && wget http://geant4.cern.ch/support/source/geant4.10.00.p02.tar.gz \ && mkdir geant4.10.00.p02-source \ && tar -xvzf geant4.10.00.p02.tar.gz -C geant4.10.00.p02-source --strip-components 1 \ && mkdir geant4.10.00.p02 \ && mkdir geant4.10.00.p02-build \ && cd geant4.10.00.p02-build \ && cmake -DCMAKE_INSTALL_PREFIX=../geant4.10.00.p02 -DGEANT4_INSTALL_DATA=ON ../geant4.10.00.p02-source \ && make ../geant4.10.00.p02 \ && make install ../geant4.10.00.p02 \ && cd .. \ && rm -rf geant4.10.00.p02-source \ && rm -rf geant4.10.00.p02-build \ && rm -rf geant4.10.00.p02.tar.gz #install scons 2.1.0 RUN cd /root \ && wget http://downloads.sourceforge.net/project/scons/scons/2.1.0/scons-2.1.0.tar.gz \ && tar -xvzf scons-2.1.0.tar.gz \ && rm -rf scons-2.1.0.tar.gz \ && chmod 0755 scons-2.1.0/script/scons \ && export RAT_SCONS=/root/scons-2.1.0 #Generate environment file RUN cd /root \ && touch env_rat-dev.sh \ && echo '#!/bin/bash' >> env_rat-dev.sh \ && echo '#rat environment' >> env_rat-dev.sh \ && echo 'export ROOTSYS=/root/root-5.34.36' >> env_rat-dev.sh \ && echo 'export RAT_SCONS=/root/scons-2.1.0' >> env_rat-dev.sh \ && echo 'source /root/geant4.10.00.p02/bin/geant4.sh' >> env_rat-dev.sh \ && echo 'export PATH=/root/root-5.34.36/bin:/root/geant4.10.0.p02/bin:$PATH' >> env_rat-dev.sh \ && echo 'export PYTHONPATH=/root/root-5.34.36/lib:$PYTHONPATH' >> env_rat-dev.sh \ && echo 'export LD_LIBRARY_PATH=/root/root-5.34.36/lib:$LD_LIBRARY_PATH' >> env_rat-dev.sh \ && echo 'export DYLD_LIBRARY_PATH=/root/root-5.34.36/lib:$DYLD_LIBRARY_PATH' >> env_rat-dev.sh #Install RAT from water_rat branch using git RUN cd /root \ && git clone git@github.com:snoplus/rat.git rat-dev \ && source ./env_rat-dev.sh \ && cd rat-dev \ && ./configure \ && git checkout -b water_rat origin/water_rat \ && source ./env.sh \ && scons #Finish the environment file RUN cd /root \ && echo 'source /root/rat-dev/env.sh' >> env_rat-dev.sh # Remove SSH keys. RUN rm -rf /root/.ssh/ ### Open terminal CMD ["/bin/bash"]