-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
177 lines (157 loc) · 5.22 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
FROM themattrix/centos5-vault-i386
# Configure yum's multilib_policy to prevent installation failures.
# https://serverfault.com/questions/77122/rhel5-forbid-installation-of-i386-packages-on-64-bit-systems
RUN echo "multilib_policy=best" >> /etc/yum.conf
# OpenSSL requires Perl >= 5.10.0, repositories have 5.8.8.
RUN set -ex; \
linux32 yum install -y \
gcc \
make \
openldap-devel \
zlib-devel \
file \
bzip2 \
bzip2-devel \
findutils \
patch \
readline-devel \
sqlite \
sqlite-devel \
xz \
xz-devel \
zlib-devel \
; \
linux32 yum clean all
ENV PERL_VERSION 5.28.1
RUN set -ex; \
cd /usr/local/src; \
rpm -i http://www.tuxad.com/rpms/tuxad-release-5-1.noarch.rpm; \
linux32 yum install -y curl; \
curl --insecure http://www.cpan.org/src/5.0/perl-$PERL_VERSION.tar.gz -LO; \
linux32 yum remove -y curl openssl1; \
rpm --erase tuxad-release; \
linux32 yum clean all; \
tar -xf perl-$PERL_VERSION.tar.gz; \
rm -f perl-$PERL_VERSION.tar.gz; \
cd perl-$PERL_VERSION; \
./Configure -des; \
make -j "$(grep -c processor /proc/cpuinfo)"; \
make install; \
cd ..; \
rm -rf perl-$PERL_VERSION
ENV OPENSSL_VERSION 1.1.0j
ENV OPENSSL_DIR /usr/local/ssl
RUN set -ex; \
cd /usr/local/src; \
rpm -i http://www.tuxad.com/rpms/tuxad-release-5-1.noarch.rpm; \
linux32 yum install -y curl; \
curl --insecure https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz -LO; \
linux32 yum remove -y curl openssl1; \
rpm --erase tuxad-release; \
linux32 yum clean all; \
tar -xf openssl-$OPENSSL_VERSION.tar.gz; \
rm -f openssl-$OPENSSL_VERSION.tar.gz; \
cd openssl-$OPENSSL_VERSION; \
./Configure -m32 linux-generic32 \
--prefix=$OPENSSL_DIR \
--openssldir=$OPENSSL_DIR \
shared \
zlib \
enable-egd \
no-async \
-Wl,-rpath,$OPENSSL_DIR/lib \
; \
make -j "$(grep -c processor /proc/cpuinfo)"; \
make install_sw; \
cd ..; \
rm -rf openssl-$OPENSSL_VERSION; \
echo $OPENSSL_DIR/lib > /etc/ld.so.conf.d/openssl-$OPENSSL_VERSION.conf; \
ldconfig -v; \
$OPENSSL_DIR/bin/openssl version -a
ENV PATH $OPENSSL_DIR/bin:$PATH
ENV PKG_CONFIG_PATH $OPENSSL_DIR/lib/pkgconfig
ENV CURL_VERSION 7.64.0
RUN set -ex; \
cd /usr/local/src; \
rpm -i http://www.tuxad.com/rpms/tuxad-release-5-1.noarch.rpm; \
linux32 yum install -y curl; \
curl --insecure -LO https://curl.haxx.se/download/curl-$CURL_VERSION.tar.gz; \
linux32 yum remove -y curl openssl1; \
rpm --erase tuxad-release; \
linux32 yum clean all; \
tar -xf curl-$CURL_VERSION.tar.gz; \
rm -f curl-$CURL_VERSION.tar.gz; \
cd curl-$CURL_VERSION; \
LDFLAGS="-Wl,-R/usr/local/lib:$OPENSSL_DIR/lib" \
./configure \
--with-ssl=$OPENSSL_DIR \
--host=i686-pc-linux-gnu CFLAGS=-m32; \
make -j "$(grep -c processor /proc/cpuinfo)"; \
make install; \
cd ..; \
rm -rf curl-$CURL_VERSION; \
/usr/local/bin/curl --version
ENV PATH /usr/local/bin:$PATH
ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
ENV PYTHON_VERSION 3.6.8
# https://stackoverflow.com/questions/5937337
COPY python-use-local-openssl.patch /usr/local/src
RUN set -ex; \
cd /usr/local/src; \
curl https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tgz -LO; \
tar -xf Python-$PYTHON_VERSION.tgz; \
rm -f Python-$PYTHON_VERSION.tgz; \
cd Python-$PYTHON_VERSION; \
patch -p1 < ../python-use-local-openssl.patch; \
./configure \
--enable-loadable-sqlite-extensions \
--without-ensurepip \
CPPFLAGS="$(pkg-config --cflags openssl) -Wl,-R$OPENSSL_DIR/lib" \
LDFLAGS="$(pkg-config --libs openssl) -Wl,-R$OPENSSL_DIR/lib" \
; \
make -j "$(grep -c processor /proc/cpuinfo)"; \
make install; \
ldconfig; \
find /usr/local -depth \
\( \
\( -type d -a \( -name test -o -name tests \) \) \
-o \
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
\) -exec rm -rf '{}' + \
; \
cd ..; \
rm -rf Python-$PYTHON_VERSION; \
python3 --version
RUN set -ex; \
cd /usr/local/bin; \
ln -s idle3 idle; \
ln -s pydoc3 pydoc; \
ln -s python3 python; \
ln -s python3-config python-config
ENV PYTHON_PIP_VERSION 19.0.3
RUN set -ex; \
cd /usr/local/src; \
curl -LO 'https://bootstrap.pypa.io/get-pip.py'; \
python3 get-pip.py \
--disable-pip-version-check \
--no-cache-dir \
"pip==$PYTHON_PIP_VERSION" \
; \
pip --version; \
find /usr/local -depth \
\( \
\( -type d -a \( -name test -o -name tests \) \) \
-o \
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
\) -exec rm -rf '{}' + \
; \
rm -f get-pip.py
ENV BUILDBOT_VERSION 2.3.0
RUN pip3 install --upgrade pip && \
pip --no-cache-dir install --only-binary cryptography twisted[tls] && \
pip --no-cache-dir install buildbot_worker==$BUILDBOT_VERSION
RUN useradd --create-home --home-dir=/var/lib/buildbot buildbot
WORKDIR /var/lib/buildbot
USER buildbot
COPY buildbot.tac .
CMD ["twistd", "--pidfile=", "--nodaemon", "--python=buildbot.tac"]