forked from JeffersonLab/clas12root
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dev.Dockerfile
62 lines (50 loc) · 1.92 KB
/
dev.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
FROM uofscphysics/root:v6_18_02
# Container with root and python/Jupyter notebooks already installed
# Dockerfiles and build at https://github.com/uofscphysics/dockerfiles
LABEL maintainer "Nick Tyler <tylern@jlab.org>"
USER root
# Setup env for RCDB
ARG RCDB_VERSION=v0.06.00
ENV RCDB_HOME /usr/local/rcdb
ENV LD_LIBRARY_PATH $RCDB_HOME/cpp/lib:$LD_LIBRARY_PATH
ENV PYTHONPATH $RCDB_HOME/python:$PYTHONPATH
ENV PATH $RCDB_HOME:$RCDB_HOME/bin:$RCDB_HOME/cpp/bin:$PATH
# Clone newest version of RCDB
# Could be changed to a specific version
RUN git clone --recurse-submodules --single-branch --branch ${RCDB_VERSION} \
https://github.com/JeffersonLab/rcdb.git /usr/local/rcdb \
&& rm -rf /usr/local/rcdb/.git
# Setup env for CCDB
ARG CCDB_VERSION=py3
ENV CCDB_HOME /usr/local/ccdb
ENV LD_LIBRARY_PATH $CCDB_HOME/lib:$LD_LIBRARY_PATH
ENV PYTHONPATH $CCDB_HOME/python:$PYTHONPATH
ENV PATH $CCDB_HOME:$CCDB_HOME/bin:$PATH
# Install scons for building CCDB
RUN git clone https://github.com/SCons/scons.git /usr/local/scons
RUN cd /usr/local/scons \
&& python setup.py install
# Clone CCDB (version defined above)
#RUN git clone --depth 1 --branch ${CCDB_VERSION} \
# https://github.com/JeffersonLab/ccdb.git /usr/local/ccdb
COPY ccdb/ /usr/local/ccdb
RUN cd $CCDB_HOME \
&& scons
# Setup env for clas12root
ARG CLAS12ROOT_VERSION=development
ENV CLAS12ROOT /usr/local/clas12root
ENV PATH $PATH:$CLAS12ROOT/bin
# Copy in the local directory contents into the contsiner
# Allows for builds on local changes for easier development and ci
COPY . /usr/local/clas12root
# Build and install clas12root
RUN mkdir -p /usr/local/clas12root/build \
&& cd /usr/local/clas12root/build \
&& cmake .. \
&& make -j$(nproc) \
&& cmake .. \
&& make install
USER user
# Set the entrypoint to clas12root so that it can be used as if it is a local executable
# Examples and functions for running in the readme file
ENTRYPOINT ["zsh"]