forked from cepc/CEPCSW
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
75 lines (63 loc) · 3.08 KB
/
Dockerfile
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
##############################################################################
# Docker image for CEPCSW
##############################################################################
# # Instruction
# To build the docker image:
# $ docker build -t cepc/cepcsw .
# Or with CVMFS installed also
# $ docker build -t cepc/cepcsw-cvmfs . --build-arg CVMFSMOD=INSIDE
#
# To publish it to DockerHub:
# $ docker push cepc/cepcsw
FROM centos:7
ARG CVMFSMOD
# Basic
RUN yum install -y sudo
RUN sudo yum install -y redhat-lsb wget
# Install singularity
RUN sudo yum update -y && \
sudo yum install -y epel-release && \
sudo yum update -y && \
sudo yum install -y singularity
# If the CVMFS is installed in the host, just mount the corresonding /CVMFS directories
# $ docker run --privileged --rm -i -t \
# -v /cvmfs/sft.cern.ch:/cvmfs/sft.cern.ch \
# -v /cvmfs/cepcsw.ihep.ac.cn:/cvmfs/cepcsw.ihep.ac.cn \
# -v /cvmfs/container.ihep.ac.cn:/cvmfs/container.ihep.ac.cn \
# cepc/cepcsw /bin/bash
# Inside the Docker container, we could start the Singularity provided by IHEP
# $ export SINGULARITY_BINDPATH=/cvmfs
# $ singularity shell /cvmfs/container.ihep.ac.cn/singularity/image/SL69/sl69worknode20200729.sif
##############################################################################
# Install CVMFS
# Configure IHEP
# Enable /cvmfs/cepcsw.ihep.ac.cn and /cvmfs/container.ihep.ac.cn
RUN if [ "$CVMFSMOD" = "INSIDE" ]; then \
sudo yum install -y https://ecsft.cern.ch/dist/cvmfs/cvmfs-release/cvmfs-release-latest.noarch.rpm \
&& sudo yum install -y cvmfs \
&& sudo mkdir /etc/cvmfs/keys/ihep.ac.cn \
&& sudo curl -o /etc/cvmfs/keys/ihep.ac.cn/ihep.ac.cn.pub http://cvmfs-stratum-one.ihep.ac.cn/cvmfs/software/client_configure/ihep.ac.cn/ihep.ac.cn.pub \
&& sudo curl -o /etc/cvmfs/domain.d/ihep.ac.cn.conf http://cvmfs-stratum-one.ihep.ac.cn/cvmfs/software/client_configure/ihep.ac.cn.conf \
&& echo "CVMFS_REPOSITORIES='sft.cern.ch,cepcsw.ihep.ac.cn,container.ihep.ac.cn'" | sudo tee /etc/cvmfs/default.local \
&& echo "CVMFS_HTTP_PROXY=DIRECT" | sudo tee -a /etc/cvmfs/default.local \
&& cat /etc/cvmfs/default.local \
&& sudo mkdir -p /cvmfs/sft.cern.ch \
&& sudo mkdir -p /cvmfs/cepcsw.ihep.ac.cn \
&& sudo mkdir -p /cvmfs/container.ihep.ac.cn; \
fi
# START Container:
# # docker run --privileged --rm -i -t cepc/cepcsw-cvmfs /bin/bash
# Due to the fuse issue, following commands need to be run inside container when --privileged is specified
# $ mount -t cvmfs sft.cern.ch /cvmfs/sft.cern.ch
# $ mount -t cvmfs container.ihep.ac.cn /cvmfs/container.ihep.ac.cn
# $ mount -t cvmfs cepcsw.ihep.ac.cn /cvmfs/cepcsw.ihep.ac.cn
##############################################################################
# Install necessary packages
##############################################################################
RUN yum install -y git
RUN yum install -y libglvnd-devel
RUN yum install -y mesa-libGLU-devel
RUN yum install -y libXmu-devel
RUN yum install -y motif-devel
# For runtime
RUN yum install -y compat-db47