forked from alabuda06/PyBNF-2.0
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
65 lines (52 loc) · 1.44 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
#
# To build Docker image, run inside PyBNF directory:
# docker build -t pybnf .
#
# Run inside PyBNF to mount examples directory inside the image:
# $ docker run -it --rm -v $(pwd)/examples:/project/examples pybnf
#
# And then inside the image:
# cd examples/demo
# pybnf -c demo_bng.conf
#
#
#### Interim build container
FROM continuumio/anaconda3
# Build BioNetGen package from source
WORKDIR /usr/src
RUN apt-get update && apt-get install -y \
autoconf \
build-essential \
cmake \
libtool \
ninja-build && \
git clone https://github.com/RuleWorld/bionetgen.git && \
cd bionetgen && \
git submodule init && \
git submodule update && \
git checkout BioNetGen-2.3.1 && \
cd bng2 && \
perl -i -ne'print unless /isnan/' Network3/src/network.h && \
./make_dist.pl --build
# Copy PyBNF source into container
WORKDIR /usr/PyBNF
COPY . .
# Build PyBNF binary wheel
RUN python3 setup.py bdist_wheel
# Build psutil binary wheel
WORKDIR /usr/PyBNF/dist
RUN pip wheel psutil
### Minimal PyBNF Docker container
FROM continuumio/miniconda3
# Copy compiled packages from build container
COPY --from=0 /usr/src/bionetgen/bng2/BioNetGen-2.3.1 /usr/BioNetGen-2.3.1
COPY --from=0 /usr/PyBNF/dist/*.whl /tmp/
# Install Python packages
WORKDIR /tmp
RUN pip install --no-cache-dir *.whl && \
rm *.whl
# Setup environment
ENV BNGPATH /usr/BioNetGen-2.3.1
ENV PATH $BNGPATH:$PATH
WORKDIR /project
CMD [ "bash" ]