-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
154 lines (135 loc) · 4.21 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
FROM lpenz/debian-squeeze-i386
# allow unauthenticated packages (keys are invalid now)
# https://askubuntu.com/a/74389/469295
RUN echo 'APT::Get::AllowUnauthenticated "true";' >> /etc/apt/apt.conf.d/10-allow-unauthenticated
RUN set -ex; \
apt-get update; \
apt-get install -y --no-install-recommends \
curl \
gcc \
make \
libc6-dev \
patch \
perl \
zlib1g-dev \
file \
libbz2-dev \
libdb-dev \
libgdbm-dev \
liblzma-dev \
libncursesw5-dev \
libreadline-dev \
libsqlite3-dev \
tk-dev \
libexpat1-dev \
libncurses5-dev \
; \
rm -rf /var/lib/apt/lists/*
ENV OPENSSL_VERSION 1.1.1b
ENV OPENSSL_DIR /usr/local/ssl
RUN set -ex; \
cd /usr/local/src; \
curl https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz -LO; \
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 \
; \
make -j "$(nproc)"; \
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; \
curl -LO https://dl.uxnr.de/mirror/curl/curl-$CURL_VERSION.tar.gz; \
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 "$(nproc)"; \
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
RUN apt-get purge -y curl libcurl3
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 \
--enable-shared \
--with-system-expat \
--with-system-ffi \
--without-ensurepip \
CPPFLAGS="$(pkg-config --cflags openssl) -Wl,-R$OPENSSL_DIR/lib" \
LDFLAGS="$(pkg-config --libs openssl) -Wl,-R$OPENSSL_DIR/lib" \
; \
make -j "$(nproc)"; \
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.1
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"]