5
5
# image with tools only needed during the image build.
6
6
7
7
# First build the temporary image.
8
- FROM alpine :3.9.6 AS builder
8
+ FROM python :3.7-slim-buster AS builder
9
9
10
10
# Execute subsequent RUN statements with bash for handy modern shell features.
11
- RUN apk add --no-cache bash
12
11
SHELL ["/bin/bash" , "-c" ]
13
12
14
13
# Add system deps for building
15
- RUN apk add -- no-cache \
14
+ RUN apt-get update && apt-get install -y -- no-install-recommends \
16
15
autoconf \
17
16
automake \
18
- build-base \
17
+ build-essential \
19
18
ca-certificates \
20
19
curl \
21
- freetype-dev \
22
20
git \
23
- gmp -dev \
21
+ libgmp -dev \
24
22
libpng-dev \
25
- linux-headers \
26
23
nodejs \
27
- nodejs-npm \
28
- perl \
29
- python3-dev \
30
- suitesparse-dev \
31
- xz
24
+ npm \
25
+ pkg-config
32
26
33
27
# Downloading dependencies, these should be pinned to specific versions
34
28
@@ -61,37 +55,6 @@ RUN curl -fsSL https://github.com/vcftools/vcftools/releases/download/v0.1.16/vc
61
55
| tar xzvpf - --strip-components=2
62
56
RUN ./configure --prefix=$PWD/built && make && make install
63
57
64
- # Install Python 3 dependencies
65
- # These may be upgraded by augur/setup.py,
66
- # but having them here enables caching
67
- # Be sure to install numpy ahead of pandas
68
-
69
- # cvxopt install is particularly fussy.
70
- # It is separated out from the rest of the installs to ensures that pip wheels
71
- # can be used for as much as possible, since using --global-option disables use
72
- # of wheels.
73
- RUN CVXOPT_BLAS_LIB=openblas \
74
- CVXOPT_LAPACK_LIB=openblas \
75
- pip3 install --global-option=build_ext \
76
- --global-option="-I/usr/include/suitesparse" \
77
- cvxopt==1.1.9
78
- RUN pip3 install numpy==1.19.4
79
- RUN pip3 install scipy==1.3.3
80
- RUN pip3 install pandas==1.1.5
81
- RUN pip3 install bcbio-gff==0.6.6
82
- RUN pip3 install biopython==1.76
83
- RUN pip3 install boto==2.49.0
84
- RUN pip3 install ipdb==0.10.1
85
- RUN pip3 install jsonschema==3.0.1
86
- RUN pip3 install matplotlib==2.2.2
87
- RUN pip3 install phylo-treetime==0.8.0
88
- RUN pip3 install requests==2.22.0
89
- RUN pip3 install rethinkdb==2.4.8
90
- RUN pip3 install seaborn==0.9.0
91
- RUN pip3 install snakemake==5.10.0
92
- RUN pip3 install unidecode==1.1.1
93
- RUN pip3 install xlrd==1.2.0
94
-
95
58
# Install envdir, which is used by pathogen builds
96
59
RUN pip3 install envdir==1.0.1
97
60
@@ -101,6 +64,9 @@ RUN pip3 install awscli==1.18.195
101
64
# Install our own CLI so builds can do things like `nextstrain deploy`
102
65
RUN pip3 install nextstrain-cli==2.0.0.post1
103
66
67
+ # Install Snakemake
68
+ RUN pip3 install snakemake==5.10.0
69
+
104
70
# Add Nextstrain components
105
71
106
72
# Allow caching to be avoided from here on out by calling
@@ -127,41 +93,37 @@ RUN pip3 install --requirement=/nextstrain/fauna/requirements.txt
127
93
# accessible and importable.
128
94
RUN pip3 install --editable /nextstrain/augur
129
95
96
+ # Install additional "full" dependencies for augur.
97
+ # TODO: these versions should be updated in augur's setup.py to work with the
98
+ # pip install nextstrain-augur[full] approach.
99
+ RUN pip3 install cvxopt==1.2.4
100
+ RUN pip3 install matplotlib==2.2.2
101
+ RUN pip3 install seaborn==0.9.0
102
+
130
103
# Install Node deps, build Auspice, and link it into the global search path. A
131
104
# fresh install is only ~40 seconds, so we're not worrying about caching these
132
105
# as we did the Python deps. Building auspice means we can run it without
133
106
# hot-reloading, which is time-consuming and generally unnecessary in the
134
107
# container image. Linking is equivalent to an editable Python install and
135
108
# used for the same reasons described above.
136
- RUN cd /nextstrain/auspice && npm install && npm run build && npm link
137
-
109
+ RUN cd /nextstrain/auspice && npm update && npm install && npm run build && npm link
138
110
139
111
# ———————————————————————————————————————————————————————————————————— #
140
112
141
-
142
113
# Now build the final image.
143
- FROM alpine :3.9.6
114
+ FROM python :3.7-slim-buster
144
115
145
116
# Add system runtime deps
146
- RUN apk add -- no-cache \
117
+ RUN apt-get update && apt-get install -y -- no-install-recommends \
147
118
bzip2 \
148
119
ca-certificates \
149
120
curl \
150
- bash \
151
- freetype \
152
- gmp \
153
121
gzip \
154
- lapack \
155
- libpng \
156
122
nodejs \
157
123
perl \
158
- python2 \
159
- python3 \
160
- suitesparse \
161
124
ruby \
162
- tar \
163
125
wget \
164
- xz \
126
+ xz-utils \
165
127
zip unzip
166
128
167
129
# Configure the prompt for interactive usage
@@ -184,7 +146,7 @@ COPY --from=builder /build/vcftools/built/share/ /usr/local/share/
184
146
RUN chmod a+rX /usr/local/bin/* /usr/local/libexec/*
185
147
186
148
# Add installed Python libs
187
- COPY --from=builder /usr/lib/python3.6 /site-packages/ /usr/lib/python3.6 /site-packages/
149
+ COPY --from=builder /usr/local/ lib/python3.7 /site-packages/ /usr/local/ lib/python3.7 /site-packages/
188
150
189
151
# Add installed Python scripts that we need.
190
152
#
@@ -196,23 +158,23 @@ COPY --from=builder /usr/lib/python3.6/site-packages/ /usr/lib/python3.6/site-pa
196
158
# troublesome or excessive.
197
159
# -trs, 15 June 2018
198
160
COPY --from=builder \
199
- /usr/bin/augur \
200
- /usr/bin/aws \
201
- /usr/bin/envdir \
202
- /usr/bin/nextstrain \
203
- /usr/bin/snakemake \
204
- /usr/bin/
161
+ /usr/local/ bin/augur \
162
+ /usr/local/ bin/aws \
163
+ /usr/local/ bin/envdir \
164
+ /usr/local/ bin/nextstrain \
165
+ /usr/local/ bin/snakemake \
166
+ /usr/local/ bin/
205
167
206
168
# Add installed Node libs
207
- COPY --from=builder /usr/lib/node_modules/ /usr/lib/node_modules/
169
+ COPY --from=builder /usr/local/ lib/node_modules/ /usr/local /lib/node_modules/
208
170
209
171
# Add globally linked Auspice script.
210
172
#
211
173
# This symlink is present in the "builder" image, but using COPY results in the
212
174
# _contents_ of the target being copied instead of a symlink being created.
213
175
# The symlink is required so that Auspice's locally-installed deps are
214
176
# correctly discovered by node.
215
- RUN ln -sv /usr/lib/node_modules/auspice/auspice.js /usr/bin/auspice
177
+ RUN ln -sv /usr/local/ lib/node_modules/auspice/auspice.js /usr/local /bin/auspice
216
178
217
179
# Add Nextstrain components
218
180
COPY --from=builder /nextstrain /nextstrain
0 commit comments