This repository has been archived by the owner on Jan 25, 2023. It is now read-only.
/
Dockerfile
382 lines (326 loc) · 12.1 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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
FROM ubuntu:14.04
MAINTAINER Netlify
################################################################################
#
# Dependencies
#
################################################################################
# language export needed for ondrej/php PPA https://github.com/oerdnj/deb.sury.org/issues/56
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get -y update && \
apt-get install -y --no-install-recommends software-properties-common language-pack-en-base apt-transport-https gnupg-curl && \
echo 'Acquire::Languages {"none";};' > /etc/apt/apt.conf.d/60language && \
echo 'LANG="en_US.UTF-8"' > /etc/default/locale && \
echo 'LANGUAGE="en_US:en"' >> /etc/default/locale && \
locale-gen en_US.UTF-8 && \
update-locale en_US.UTF-8 && \
export LANG=en_US.UTF-8 && \
export LANGUAGE=en_US.UTF-8 && \
export LC_ALL=en_US.UTF-8 && \
apt-key adv --fetch-keys https://packagecloud.io/github/git-lfs/gpgkey && \
apt-add-repository -y -s 'deb https://packagecloud.io/github/git-lfs/ubuntu/ trusty main' && \
add-apt-repository -y ppa:ondrej/php && \
add-apt-repository -y ppa:openjdk-r/ppa && \
add-apt-repository -y ppa:git-core/ppa && \
add-apt-repository -y ppa:rwky/graphicsmagick && \
apt-get -y update && \
apt-get install -y --no-install-recommends \
advancecomp \
apache2-utils \
autoconf \
automake \
bison \
build-essential \
bzr \
cmake \
curl \
fontconfig \
fontconfig-config \
g++ \
gawk \
git \
git-lfs \
gifsicle \
gobject-introspection \
graphicsmagick \
graphviz \
gtk-doc-tools \
imagemagick \
jpegoptim \
jq \
language-pack-ar \
language-pack-cs \
language-pack-da \
language-pack-de \
language-pack-el \
language-pack-es \
language-pack-fi \
language-pack-fil \
language-pack-fr \
language-pack-he \
language-pack-hi \
language-pack-it \
language-pack-ja \
language-pack-ka \
language-pack-ko \
language-pack-nan \
language-pack-nn \
language-pack-pl \
language-pack-pt \
language-pack-ro \
language-pack-ru \
language-pack-sa \
language-pack-sv \
language-pack-ta \
language-pack-th \
language-pack-tr \
language-pack-uk \
language-pack-vi \
language-pack-yi \
language-pack-zh-hans \
language-pack-zh-hant \
libasound2 \
libcurl3 \
libcurl3-gnutls \
libcurl3-openssl-dev \
libexif-dev \
libffi-dev \
libfontconfig1 \
libgconf-2-4 \
libgd-dev \
libgdbm-dev \
libgif-dev \
libglib2.0-dev \
libgmp3-dev \
libgraphicsmagick3 \
libgtk-3-0 \
libgtk2.0-0 \
libicu-dev \
libimage-exiftool-perl \
libjpeg-progs \
libjpeg-turbo8-dev \
libmagickwand-dev \
libmcrypt-dev \
libncurses5-dev \
libnss3 \
libpng12-dev \
libreadline6-dev \
libsm6 \
libsqlite3-dev \
libssl-dev \
libtiff5-dev \
libwebp-dev \
libwebp5 \
libxml2-dev \
libxrender1 \
libxslt-dev \
libxss1 \
libxtst6 \
libyaml-dev \
mercurial \
openjdk-8-jdk \
optipng \
pandoc \
php5.6 \
php7.2 \
pngcrush \
python-setuptools \
python2.7-dev \
python3 \
python3-dev \
software-properties-common \
sqlite3 \
ssh \
strace \
swig \
unzip \
wget \
xvfb \
zip \
&& \
/var/lib/dpkg/info/ca-certificates-java.postinst configure && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
apt-get autoremove -y && \
unset DEBIAN_FRONTEND
RUN wget -nv https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz && \
tar -xf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz && \
cd wkhtmltox && \
cp -r ./ /usr/ && \
wkhtmltopdf -V
RUN wget -nv https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tar.xz && \
tar -xf Python-3.5.2.tar.xz && \
cd Python-3.5.2 && \
./configure && \
make && \
make install && \
ln -fs /opt/Python-3.5.2/Python /usr/bin/python3.5 && \
cd .. && \
rm -r Python-3.5.2.tar.xz Python-3.5.2
RUN wget -nv https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tar.xz && \
tar -xf Python-3.6.2.tar.xz && \
cd Python-3.6.2 && \
./configure && \
make && \
make install && \
ln -fs /opt/Python-3.6.2/Python /usr/bin/python3.6 && \
cd .. && \
rm -r Python-3.6.2.tar.xz Python-3.6.2
################################################################################
#
# Libvips
#
################################################################################
WORKDIR /tmp
# this actually builds v8.6.2
RUN \
curl -sLo vips-8.6.2.tar.gz https://github.com/jcupitt/libvips/releases/download/v8.6.2/vips-8.6.2.tar.gz && \
tar xvf vips-8.6.2.tar.gz && \
cd vips-8.6.2 && \
./configure --enable-debug=no --enable-docs=no --without-python --without-orc --without-fftw --without-gsf $1 && \
make && \
make install && \
ldconfig
WORKDIR /
################################################################################
#
# User
#
################################################################################
RUN adduser --system --disabled-password --uid 2500 --quiet buildbot --home /opt/buildhome
################################################################################
#
# Ruby
#
################################################################################
USER buildbot
RUN gpg --keyserver hkp://pool.sks-keyservers.net --recv-keys D39DC0E3 && \
curl -sL https://get.rvm.io | bash -s stable --with-gems="bundler" --autolibs=read-fail
ENV PATH /usr/local/rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
RUN /bin/bash -c "source ~/.rvm/scripts/rvm && \
rvm install 2.2.9 && rvm use 2.2.9 && gem install bundler && \
rvm install 2.3.6 && rvm use 2.3.6 && gem install bundler && \
rvm install 2.4.3 && rvm use 2.4.3 && gem install bundler && \
rvm use 2.3.6 --default && rvm cleanup all"
ENV PATH /usr/local/rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
USER root
################################################################################
#
# Node.js
#
################################################################################
RUN curl -o- -L https://yarnpkg.com/install.sh > /usr/local/bin/yarn-installer.sh
# Install node.js
USER buildbot
RUN git clone https://github.com/creationix/nvm.git ~/.nvm && \
cd ~/.nvm && \
git checkout v0.33.4 && \
cd /
ENV ELM_VERSION=0.17.1
ENV YARN_VERSION=1.3.2
RUN /bin/bash -c ". ~/.nvm/nvm.sh && \
nvm install 4 && nvm use 4 && npm install -g sm grunt-cli bower elm@$ELM_VERSION && \
bash /usr/local/bin/yarn-installer.sh --version $YARN_VERSION && \
nvm install 6 && nvm use 6 && npm install -g sm grunt-cli bower elm@$ELM_VERSION && \
bash /usr/local/bin/yarn-installer.sh --version $YARN_VERSION && \
nvm install 8 && nvm use 8 && npm install -g sm grunt-cli bower elm@$ELM_VERSION && \
bash /usr/local/bin/yarn-installer.sh --version $YARN_VERSION && \
nvm alias default node && nvm cache clear"
USER root
################################################################################
#
# Python
#
################################################################################
RUN easy_install virtualenv
USER buildbot
RUN virtualenv -p python2.7 --no-site-packages /opt/buildhome/python2.7 && \
/bin/bash -c 'source /opt/buildhome/python2.7/bin/activate' && \
ln -nfs /opt/buildhome/python2.7 /opt/buildhome/python2.7.4
RUN virtualenv -p python3.4 --no-site-packages /opt/buildhome/python3.4 && \
/bin/bash -c 'source /opt/buildhome/python3.4/bin/activate' && \
ln -nfs /opt/buildhome/python3.4 /opt/buildhome/python3.4.0
RUN virtualenv -p python3.5 --no-site-packages /opt/buildhome/python3.5 && \
/bin/bash -c 'source /opt/buildhome/python3.5/bin/activate' && \
ln -nfs /opt/buildhome/python3.5 /opt/buildhome/python3.5.2
RUN virtualenv -p python3.6 --no-site-packages /opt/buildhome/python3.6 && \
/bin/bash -c 'source /opt/buildhome/python3.6/bin/activate' && \
ln -nfs /opt/buildhome/python3.6 /opt/buildhome/python3.6.2
USER root
################################################################################
#
# Hugo
#
################################################################################
ENV BINRC_VERSION 0.2.5
RUN mkdir /opt/binrc && cd /opt/binrc && \
curl -sL https://github.com/netlify/binrc/releases/download/v${BINRC_VERSION}/binrc_${BINRC_VERSION}_Linux-64bit.tar.gz | tar zxvf - && \
ln -s /opt/binrc/binrc_${BINRC_VERSION}_linux_amd64/binrc_${BINRC_VERSION}_linux_amd64 /usr/local/bin/binrc
RUN binrc install -cache-store-path /opt/buildhome/.binrc spf13/hugo 0.17 | xargs -n 1 -I{} ln -s {} /usr/local/bin/hugo_0.17 && \
binrc install -cache-store-path /opt/buildhome/.binrc spf13/hugo 0.18 | xargs -n 1 -I{} ln -s {} /usr/local/bin/hugo_0.18 && \
binrc install -cache-store-path /opt/buildhome/.binrc spf13/hugo 0.19 | xargs -n 1 -I{} ln -s {} /usr/local/bin/hugo_0.19 && \
binrc install -cache-store-path /opt/buildhome/.binrc spf13/hugo 0.20 | xargs -n 1 -I{} ln -s {} /usr/local/bin/hugo_0.20 && \
ln -s /usr/local/bin/hugo_0.17 /usr/local/bin/hugo
################################################################################
#
# Clojure
#
################################################################################
RUN mkdir /opt/leiningen && cd /opt/leiningen && \
curl -sL https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein > lein && \
chmod +x lein && \
ln -s /opt/leiningen/lein /usr/local/bin/lein
RUN mkdir /opt/boot-clj && cd /opt/boot-clj && \
curl -sL https://github.com/boot-clj/boot-bin/releases/download/2.5.2/boot.sh > boot && \
chmod +x boot && \
ln -s /opt/boot-clj/boot /usr/local/bin/boot
USER buildbot
RUN lein
RUN boot -u
################################################################################
#
# PHP
#
################################################################################
USER root
# set default to 5.6
RUN update-alternatives --set php /usr/bin/php5.6 && \
update-alternatives --set phar /usr/bin/phar5.6 && \
update-alternatives --set phar.phar /usr/bin/phar.phar5.6
USER buildbot
RUN mkdir -p /opt/buildhome/.php && ln -s /usr/bin/php5.6 /opt/buildhome/.php/php
ENV PATH "/opt/buildhome/.php:$PATH"
################################################################################
#
# Emacs and Cask
#
################################################################################
USER root
ENV EMACS_VERSION 25.3
RUN wget -nv http://ftpmirror.gnu.org/emacs/emacs-${EMACS_VERSION}.tar.gz && \
tar -xf emacs-${EMACS_VERSION}.tar.gz && \
cd emacs-${EMACS_VERSION} && \
env CANNOT_DUMP=yes ./configure --without-x && \
make install && \
make clean && \
cd .. && rm -rf emacs-${EMACS_VERSION} emacs-${EMACS_VERSION}.tar.gz
USER buildbot
RUN rm -rf /opt/buildhome/.cask && git clone https://github.com/cask/cask.git /opt/buildhome/.cask
ENV PATH "$PATH:/opt/buildhome/.cask/bin"
###
# LZ4 Compression
###
USER root
ENV LZ4_VERSION 1.8.0
RUN curl -sL https://github.com/lz4/lz4/archive/v${LZ4_VERSION}.tar.gz | tar xzvf - && \
cd lz4-${LZ4_VERSION} && \
make && \
make install && \
cd .. && rm -rf lz4-${LZ4_VERSION}
# Cleanup
USER root
# Add buildscript for local testing
ADD run-build-functions.sh /usr/local/bin/run-build-functions.sh
ADD run-build.sh /usr/local/bin/build
ADD buildbot-git-config /opt/buildhome/.gitconfig
USER buildbot