1+ #
2+ # NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh"
3+ #
4+ # PLEASE DO NOT EDIT IT DIRECTLY.
5+ #
6+
7+ FROM debian:stretch-slim
8+
9+ # ensure local python is preferred over distribution python
10+ ENV PATH /usr/local/bin:$PATH
11+
12+ # http://bugs.python.org/issue19846
13+ # > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
14+ ENV LANG C.UTF-8
15+
16+ # runtime dependencies
17+ RUN apt-get update && apt-get install -y --no-install-recommends \
18+ ca-certificates \
19+ libexpat1 \
20+ libffi6 \
21+ libgdbm3 \
22+ libreadline7 \
23+ libsqlite3-0 \
24+ libssl1.1 \
25+ netbase \
26+ && rm -rf /var/lib/apt/lists/*
27+
28+ ENV GPG_KEY 97FC712E4C024BBEA48A61ED3A5CA953F73C700D
29+ ENV PYTHON_VERSION 3.5.5
30+
31+ RUN set -ex \
32+ && buildDeps=" \
33+ dpkg-dev \
34+ gcc \
35+ libbz2-dev \
36+ libc6-dev \
37+ libexpat1-dev \
38+ libffi-dev \
39+ libgdbm-dev \
40+ liblzma-dev \
41+ libncursesw5-dev \
42+ libreadline-dev \
43+ libsqlite3-dev \
44+ libssl-dev \
45+ make \
46+ tcl-dev \
47+ tk-dev \
48+ wget \
49+ xz-utils \
50+ zlib1g-dev \
51+ # as of Stretch, " gpg" is no longer included by default
52+ $(command -v gpg > /dev/null || echo 'gnupg dirmngr') \
53+ " \
54+ && apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
55+ \
56+ && wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \
57+ && wget -O python.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \
58+ && export GNUPGHOME="$(mktemp -d)" \
59+ && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \
60+ && gpg --batch --verify python.tar.xz.asc python.tar.xz \
61+ && rm -rf "$GNUPGHOME" python.tar.xz.asc \
62+ && mkdir -p /usr/src/python \
63+ && tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \
64+ && rm python.tar.xz \
65+ \
66+ && cd /usr/src/python \
67+ && gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
68+ && ./configure \
69+ --build="$gnuArch" \
70+ --enable-loadable-sqlite-extensions \
71+ --enable-shared \
72+ --with-system-expat \
73+ --with-system-ffi \
74+ --without-ensurepip \
75+ && make -j "$(nproc)" \
76+ && make install \
77+ && ldconfig \
78+ \
79+ && apt-get purge -y --auto-remove $buildDeps \
80+ \
81+ && find /usr/local -depth \
82+ \( \
83+ \( -type d -a \( -name test -o -name tests \) \) \
84+ -o \
85+ \( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
86+ \) -exec rm -rf '{}' + \
87+ && rm -rf /usr/src/python
88+
89+ # make some useful symlinks that are expected to exist
90+ RUN cd /usr/local/bin \
91+ && ln -s idle3 idle \
92+ && ln -s pydoc3 pydoc \
93+ && ln -s python3 python \
94+ && ln -s python3-config python-config
95+
96+ # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
97+ ENV PYTHON_PIP_VERSION 10.0.1
98+
99+ RUN set -ex; \
100+ \
101+ apt-get update; \
102+ apt-get install -y --no-install-recommends wget; \
103+ rm -rf /var/lib/apt/lists/*; \
104+ \
105+ wget -O get-pip.py 'https://bootstrap.pypa.io/get-pip.py' ; \
106+ \
107+ apt-get purge -y --auto-remove wget; \
108+ \
109+ python get-pip.py \
110+ --disable-pip-version-check \
111+ --no-cache-dir \
112+ "pip==$PYTHON_PIP_VERSION" \
113+ ; \
114+ pip --version; \
115+ \
116+ find /usr/local -depth \
117+ \( \
118+ \( -type d -a \( -name test -o -name tests \) \) \
119+ -o \
120+ \( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
121+ \) -exec rm -rf '{}' +; \
122+ rm -f get-pip.py
123+
124+ CMD ["python3" ]
0 commit comments