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,40 +93,35 @@ 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
ca-certificates \
148
119
curl \
149
- bash \
150
- freetype \
151
- gmp \
152
120
gzip \
153
- lapack \
154
- libpng \
155
121
nodejs \
156
- perl \
157
- python2 \
158
- python3 \
159
- suitesparse \
160
122
ruby \
161
- tar \
162
123
wget \
163
- xz \
124
+ xz-utils \
164
125
zip unzip
165
126
166
127
# Configure the prompt for interactive usage
@@ -183,7 +144,7 @@ COPY --from=builder /build/vcftools/built/share/ /usr/local/share/
183
144
RUN chmod a+rX /usr/local/bin/* /usr/local/libexec/*
184
145
185
146
# Add installed Python libs
186
- COPY --from=builder /usr/lib/python3.6 /site-packages/ /usr/lib/python3.6 /site-packages/
147
+ COPY --from=builder /usr/local/ lib/python3.7 /site-packages/ /usr/local/ lib/python3.7 /site-packages/
187
148
188
149
# Add installed Python scripts that we need.
189
150
#
@@ -195,22 +156,22 @@ COPY --from=builder /usr/lib/python3.6/site-packages/ /usr/lib/python3.6/site-pa
195
156
# troublesome or excessive.
196
157
# -trs, 15 June 2018
197
158
COPY --from=builder \
198
- /usr/bin/augur \
199
- /usr/bin/aws \
200
- /usr/bin/nextstrain \
201
- /usr/bin/snakemake \
202
- /usr/bin/
159
+ /usr/local/ bin/augur \
160
+ /usr/local/ bin/aws \
161
+ /usr/local/ bin/nextstrain \
162
+ /usr/local/ bin/snakemake \
163
+ /usr/local/ bin/
203
164
204
165
# Add installed Node libs
205
- COPY --from=builder /usr/lib/node_modules/ /usr/lib/node_modules/
166
+ COPY --from=builder /usr/local/ lib/node_modules/ /usr/local /lib/node_modules/
206
167
207
168
# Add globally linked Auspice script.
208
169
#
209
170
# This symlink is present in the "builder" image, but using COPY results in the
210
171
# _contents_ of the target being copied instead of a symlink being created.
211
172
# The symlink is required so that Auspice's locally-installed deps are
212
173
# correctly discovered by node.
213
- RUN ln -sv /usr/lib/node_modules/auspice/auspice.js /usr/bin/auspice
174
+ RUN ln -sv /usr/local/ lib/node_modules/auspice/auspice.js /usr/local /bin/auspice
214
175
215
176
# Add Nextstrain components
216
177
COPY --from=builder /nextstrain /nextstrain
0 commit comments