-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
41 lines (35 loc) · 1.07 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
FROM frolvlad/alpine-glibc AS builder
MAINTAINER Amine Ben Asker <[email protected]>
ARG python_version
ARG python_configure_options=""
RUN apk add --no-cache wget \
gcc \
make \
openssl-dev \
musl-dev \
zlib-dev \
sqlite-dev \
linux-headers \
libffi-dev \
readline-dev \
xz-dev
RUN cd /tmp \
&& wget https://www.python.org/ftp/python/${python_version}/Python-${python_version}.tgz \
&& tar -xf Python-${python_version}.tgz \
&& cd Python-${python_version} \
&& ./configure ${python_configure_options} \
--enable-loadable-sqlite-extensions \
--enable-shared \
--with-system-ffi \
&& make -j "$(nproc)" \
&& make install
RUN find /usr/local -depth \
\( \
\( -type d -a \( -name test -o -name tests \) \) \
-o \
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
\) -exec rm -rf '{}' +
FROM alpine
MAINTAINER Amine Ben Asker <[email protected]>
COPY --from=builder /usr/local /usr/local
RUN apk add --no-cache libffi