forked from WCSim/WCSim
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.base
More file actions
88 lines (76 loc) · 2.85 KB
/
Dockerfile.base
File metadata and controls
88 lines (76 loc) · 2.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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
### Created by Dr. Benjamin Richards (b.richards@qmul.ac.uk) based on docker file from Stephane Zsoldos (s.zsoldos@qmul.ac.uk)
### Download base image from cern repo on docker hub
FROM cern/cc7-base:latest
### Run the following commands as super user (root):
USER root
#######################
### GCC ENVIRONMENT ###
#######################
### Required package for ROOT
RUN yum install -y \
wget \
tar \
cmake \
gcc-c++ \
gcc \
binutils \
libX11-devel \
libXpm-devel \
libXft-devel \
libXext-devel \
libzstd-devel \
git \
mesa-libGL-devel \
mesa-libGLU-devel \
libXmu-devel \
libXi-devel \
expat-devel \
make \
which \
emacs \
&& yum clean all \
&& rm -rf /var/cache/yum
### Setup environment
ENV HYPERKDIR /opt/HyperK
RUN mkdir $HYPERKDIR
WORKDIR $HYPERKDIR
### Downloading ROOT
RUN wget https://root.cern.ch/download/root_v6.20.04.Linux-centos7-x86_64-gcc4.8.tar.gz -O root.tar.gz \
&& tar -xvzf root.tar.gz \
&& rm -f root.tar.gz
### Downloading Geant4
### There is no precompiled CentOS7 version of G4.10.1, so we need to compile it from source instead
#RUN wget http://cern.ch/geant4-data/releases/lib4.10.1.p03/Linux-g++4.4.7-SLC6.tar.gz -O geant.tar.gz \
# && tar -xvzf geant.tar.gz \
# && rm -f geant.tar.gz
RUN wget http://cern.ch/geant4-data/releases/geant4.10.01.p03.tar.gz -O geant.tar.gz \
&& tar -xvzf geant.tar.gz \
&& rm -f geant.tar.gz
RUN mkdir $HYPERKDIR/geant4.10.01.p03-build
RUN mkdir $HYPERKDIR/geant4.10.01.p03-install
WORKDIR $HYPERKDIR/geant4.10.01.p03-build
RUN cmake -DCMAKE_INSTALL_PREFIX=$HYPERKDIR/geant4.10.01.p03-install -DGEANT4_INSTALL_DATA=ON $HYPERKDIR/geant4.10.01.p03
RUN make -j`nproc`
RUN make install
### Data files for Geant4 #done above now; keep here for reference to do in future if we use precompiled again
#ENV G4DATA $HYPERKDIR/Geant4-10.1.3-Linux/share/Geant4-10.1.3/data
#WORKDIR $G4DATA
#RUN for f in G4ABLA.3.0.tar.gz G4NDL.4.5.tar.gz G4EMLOW.6.41.tar.gz G4PhotonEvaporation.3.1.tar.gz G4RadioactiveDecay.4.2.tar.gz #G4SAIDDATA.1.1.tar.gz G4NEUTRONXS.1.4.tar.gz G4PII.1.3.tar.gz RealSurface.1.0.tar.gz G4ENSDFSTATE.1.0.tar.gz; do \
# echo $f; \
# wget http://cern.ch/geant4-data/datasets/$f; \
# tar -xzvf $f; \
# rm -f $f; \
# done
### ENV Geant4
ENV WCSIMDIR $HYPERKDIR/WCSim
ENV G4WORKDIR $WCSIMDIR/exe
ENV G4INSTALLDIR $HYPERKDIR/geant4.10.01.p03-install
ENV G4LIB $G4INSTALL/lib
### Make a setup script
WORKDIR $HYPERKDIR
RUN echo '#!/bin/bash -x' > env-WCSim.sh \
&& echo 'source $HYPERKDIR/root/bin/thisroot.sh' >> env-WCSim.sh \
&& echo 'source $G4INSTALLDIR/bin/geant4.sh' >> env-WCSim.sh \
&& echo 'source $G4INSTALLDIR/share/Geant4-10.1.3/geant4make/geant4make.sh' >> env-WCSim.sh
### Open terminal
CMD ["/bin/bash"]