-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
134 lines (126 loc) · 4 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
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
122
123
124
125
126
127
128
129
130
131
132
133
134
# 1. Download ChemAxon Marvin for Debian from https://chemaxon.com/ and save to ./Dockerfile_assets/marvin_linux.deb
# 2. Obtain license for Marvin and save to ./Dockerfile_assets/chemaxon.license.cxl
# 3. Build with `docker build -f Dockerfile Dockerfile_assets --tag karrlab/bpforms:latest`
# Start from Ubuntu (e.g., bionic - 18.04.4)
FROM ubuntu
# Set default language to UTF-8 US English
RUN apt-get update -y \
&& apt-get install --no-install-recommends -y \
locales \
&& rm -rf /var/lib/apt/lists/* \
&& locale-gen en_US.UTF-8
ENV LC_ALL=en_US.UTF-8
# Install Python (e.g., 3.6.9), pip, and setuptools
RUN apt-get update -y \
&& apt-get install --no-install-recommends -y \
python3 \
python3-pip \
&& pip3 install -U pip setuptools \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/*
# Install Open Babel 2.4.1
ARG openbabel_version=2.4.1
RUN apt-get update -y \
&& apt-get install --no-install-recommends -y \
build-essential \
cmake \
libcairo2-dev \
libeigen3-dev \
libxml2 \
libxml2-dev \
tar \
wget \
zlib1g-dev \
\
&& cd /tmp \
&& openbabel_version_dash=$(echo $openbabel_version | sed 's/\./-/g') \
&& wget https://github.com/openbabel/openbabel/archive/openbabel-${openbabel_version_dash}.tar.gz -O /tmp/openbabel-${openbabel_version}.tar.gz \
&& tar -xvvf /tmp/openbabel-${openbabel_version}.tar.gz \
&& cd openbabel-openbabel-${openbabel_version_dash} \
&& mkdir build \
&& cd build \
&& cmake .. \
&& make \
# && make test \
&& make install \
&& ldconfig \
&& cd / \
&& rm -r /tmp/openbabel-${openbabel_version}.tar.gz \
&& rm -r /tmp/openbabel-openbabel-${openbabel_version_dash} \
\
&& apt-get remove -y \
build-essential \
cmake \
libcairo2-dev \
libeigen3-dev \
libxml2-dev \
wget \
zlib1g-dev \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/*
# Install Open Babel Python interface
RUN apt-get update -y \
&& apt-get install --no-install-recommends -y \
build-essential \
libpython3-dev \
swig \
\
&& pip3 install openbabel \
\
&& apt-get remove -y \
build-essential \
libpython3-dev \
swig \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/*
# Install ChemAxon Marvin (e.g., 20.6)
COPY ./marvin_linux.deb /tmp/
COPY ./chemaxon.license.cxl /tmp/
RUN apt-get update -y \
&& apt-get install --no-install-recommends -y \
default-jdk \
default-jre \
\
&& mkdir ~/.chemaxon \
&& mv /tmp/chemaxon.license.cxl ~/.chemaxon/license.cxl \
&& dpkg -i /tmp/marvin_linux.deb \
\
&& rm /tmp/marvin_linux.deb \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/*
ENV JAVA_HOME=/usr/lib/jvm/default-java \
CLASSPATH=${CLASSPATH}:/opt/chemaxon/marvinsuite/lib/MarvinBeans.jar
# Install BcForms and BpForms
RUN pip3 install \
bcforms[draw] \
bpforms[draw,onto_export,protonation]
# Test installations of BcForms and BpForms
ARG test=1
RUN if [ "$test" = "1" ]; then \
apt-get update -y \
&& apt-get install --no-install-recommends -y \
git \
build-essential \
libpython3-dev \
\
&& cd / \
&& git clone https://github.com/KarrLab/bpforms.git \
&& git clone https://github.com/KarrLab/bcforms.git \
&& pip3 install pytest \
&& pip3 install -r bpforms/tests/requirements.txt \
&& pip3 install -r bcforms/tests/requirements.txt \
&& cd /bpforms \
&& python3 -m pytest tests/test_core.py tests/test_main.py \
&& cd /bcforms \
&& python3 -m pytest tests/test_core.py tests/test_main.py \
\
&& cd / \
&& rm -r bpforms \
&& rm -r bcforms \
&& apt-get remove -y \
git \
build-essential \
libpython3-dev \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/*; \
fi