-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
141 lines (124 loc) · 3.59 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
FROM debian/eol:wheezy
RUN sed -i \
-e s/deb.debian.org/archive.debian.org/ \
-e /wheezy-updates/d \
/etc/apt/sources.list
RUN set -ex; \
apt-get update; \
apt-get install -y --no-install-recommends \
ca-certificates \
curl \
gcc \
make \
libc6-dev \
patch \
perl \
zlib1g-dev \
libbz2-dev \
libdb-dev \
libgdbm-dev \
liblzma-dev \
libncursesw5-dev \
libreadline-dev \
libsqlite3-dev \
tk-dev \
build-essential \
libc6-dev \
libexpat-dev \
libffi-dev \
libz-dev \
uuid-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; \
./config \
--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 PATH /usr/local/bin:$PATH
# http://bugs.python.org/issue19846
ENV LANG C.UTF-8
ENV PYTHON_VERSION 3.7.4
# 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.2.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.5.0
RUN pip3 install --upgrade pip && \
pip --no-cache-dir install 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"]