-
Notifications
You must be signed in to change notification settings - Fork 68
Expand file tree
/
Copy pathDockerfile.root5
More file actions
121 lines (98 loc) · 4.34 KB
/
Dockerfile.root5
File metadata and controls
121 lines (98 loc) · 4.34 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
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
# Pull SL7 image by digest (immutable identifier)
FROM scientificlinux/sl@sha256:437d3402c454319a5443bb5a99844c8d6f454828c59dcfb2730f1bdff8f2f48c AS prep-stage
SHELL ["/bin/bash", "-c"]
ENV LC_ALL=en_US.UTF-8
RUN yum update -q -y \
&& yum install -y \
gcc gcc-c++ gcc-gfortran \
git bzip2 unzip file which make imake patch \
flex-devel libcurl-devel \
perl perl-Data-Dumper \
lapack-static blas-static \
libX11-devel libXext-devel libXpm-devel openmotif-devel \
&& yum clean all
# Install cernlib
RUN mkdir /cern && cd /cern \
&& curl -sL https://github.com/psilib/cernlib/archive/centos7.tar.gz | tar -xz --strip-components 1 \
&& ./build_cernlib.sh \
&& mv /usr/lib64/libblas.a /cern/2006/lib/libblas.a \
&& mv /usr/lib64/liblapack.a /cern/2006/lib/liblapack3.a \
&& ln -s 2006 /cern/pro \
&& rm -fr /cern/2006/src /cern/2006/build
RUN mkdir -p star-spack \
&& curl -sL https://github.com/star-bnl/star-spack/archive/fba3a3ffbafc0c77fa46085d807b717ca807f345.tar.gz | tar -xz --strip-components 1 -C star-spack \
&& curl -sL https://github.com/spack/spack/archive/010e5761d6631eae102d1eec87e5e74a0e16ed82.tar.gz | tar -xz --strip-components 1 -C star-spack/spack
RUN source star-spack/setup.sh \
&& spack env create star-env-root star-spack/environments/star-x86_64-root-5.34.38-container.yaml \
&& spack env activate star-env-root \
&& spack install -j 5 --fail-fast \
&& spack gc -y \
&& spack clean --all \
&& spack uninstall --force -y llvm \
# Create star-spack/spack/var/spack/environments/star-env-root/loads
&& spack -e star-env-root env loads
# Strip all the binaries
RUN find -L /opt/software/* -type f -exec readlink -f '{}' \; | \
xargs file -i | \
grep 'charset=binary' | \
grep 'x-executable\|x-archive\|x-sharedlib' | \
awk -F: '{print $1}' | xargs strip -S
FROM scientificlinux/sl@sha256:437d3402c454319a5443bb5a99844c8d6f454828c59dcfb2730f1bdff8f2f48c AS base-stage
SHELL ["/bin/bash", "-c"]
ENV LC_ALL=en_US.UTF-8
COPY --from=prep-stage /opt/software /opt/software
COPY --from=prep-stage /cern /cern
COPY --from=prep-stage /star-spack/spack/var/spack/environments/star-env-root/loads /etc/profile.d/z10_load_spack_env_modules.sh
COPY --from=prep-stage /star-spack/spack/share/spack/modules/linux-scientific7-x86_64 /opt/linux-scientific7-x86_64
# epel repo is for python-pip only
RUN yum update -q -y \
&& yum install -y epel-release \
&& yum install -y \
binutils gcc gcc-c++ gcc-gfortran \
git bzip2 file which make patch \
bison byacc flex flex-devel libcurl-devel \
perl perl-Env perl-Digest-MD5 \
libX11-devel libXext-devel libXpm-devel libXt-devel \
python python-pip \
environment-modules \
&& yum clean all
# Install extra python modules used by the STAR software
RUN pip install pyparsing==2.2.0
ENV MODULEPATH=/opt/linux-scientific7-x86_64
ENV STAR=/star-sw
ENV USE_64BITS=1
ENV CERN=/cern
ENV CERN_LEVEL=pro
ENV CERN_ROOT=$CERN/$CERN_LEVEL
ENV OPTSTAR=/opt/software
ENV STAR_HOST_SYS=sl79_gcc485
ENV NODEBUG=yes
ENV STAR_LIB=$STAR/.${STAR_HOST_SYS}/LIB
ENV STAR_BIN=$STAR/.${STAR_HOST_SYS}/BIN
ENV STAR_SYS=x8664_sl7
ENV PATH=$CERN_ROOT/bin:$STAR_BIN:$STAR/mgr:$PATH
ENV LD_LIBRARY_PATH=$STAR_LIB:$LD_LIBRARY_PATH
ENV LIBPATH+=:/lib64:/lib
ENV MYSQL=/opt/software/linux-scientific7-x86_64/gcc-4.8.5/mysql-5.7.27-pfyt3fwtkubcc5eazmoqfick3lgp67mf
ENV LIBXML2_DIR=/opt/software/linux-scientific7-x86_64/gcc-4.8.5/libxml2-2.9.10-4lxsmpa57bm3xs2cs3xapk3qccxflkfl
ENV FASTJET_DIR=/opt/software/linux-scientific7-x86_64/gcc-4.8.5/fastjet-3.3.3-xj22tput5pd5atejy4igsrtgdtygi74u
ENV GSL_DIR=/opt/software/linux-scientific7-x86_64/gcc-4.8.5/gsl-2.6-ao26bt7pm6xxywo2q7dcmhhg2lp2inx7
# Dummy directories checked by cons
RUN mkdir $OPTSTAR/lib && mkdir $OPTSTAR/include
RUN ln -s $MYSQL/include /usr/include/mysql
FROM base-stage AS build-stage
COPY . /star-sw
RUN source /etc/profile \
&& cd /star-sw \
&& cons \
&& find /star-sw/.$STAR_HOST_SYS -name *.o -exec rm '{}' \;
RUN install /star-sw/StRoot/macros/.rootrc .
# One might expect the single ENTRYPOINT command below to work but for some
# reason it chokes on a complex command such as
#
# docker run image root4star -b 'bfc.C(10, "opt1", "infile.root")'
#
#ENTRYPOINT ["/bin/bash", "--rcfile", "/etc/profile", "-l", "-c"]
RUN install -m 755 <(echo $'#!/bin/sh\n . /etc/profile; exec "$@"') entrypoint.sh
ENTRYPOINT ["./entrypoint.sh"]
CMD ["/bin/bash"]