Skip to content

Commit d03644b

Browse files
committed
Merge pull request docker-library#48 from TimeIncOSS/python32
Add support for Python 3.2
2 parents ab89b4c + 8ac0675 commit d03644b

File tree

5 files changed

+156
-0
lines changed

5 files changed

+156
-0
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ env:
1010
- VERSION=3.3 VARIANT=
1111
- VERSION=3.3 VARIANT=slim
1212
- VERSION=3.3 VARIANT=wheezy
13+
- VERSION=3.2 VARIANT=
14+
- VERSION=3.2 VARIANT=slim
15+
- VERSION=3.2 VARIANT=wheezy
1316
- VERSION=2.7 VARIANT=
1417
- VERSION=2.7 VARIANT=slim
1518
- VERSION=2.7 VARIANT=wheezy

3.2/Dockerfile

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
FROM buildpack-deps:jessie
2+
3+
# remove several traces of debian python
4+
RUN apt-get purge -y python.*
5+
6+
# http://bugs.python.org/issue19846
7+
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
8+
ENV LANG C.UTF-8
9+
10+
# gpg: key 36580288: public key "Georg Brandl (Python release signing key) <georg@python.org>" imported
11+
RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 26DEA9D4613391EF3E25C9FF0A5B101836580288
12+
13+
ENV PYTHON_VERSION 3.2.6
14+
15+
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
16+
ENV PYTHON_PIP_VERSION 7.0.0
17+
18+
RUN set -x \
19+
&& mkdir -p /usr/src/python \
20+
&& curl -SL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \
21+
&& curl -SL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz.asc" -o python.tar.xz.asc \
22+
&& gpg --verify python.tar.xz.asc \
23+
&& tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \
24+
&& rm python.tar.xz* \
25+
&& cd /usr/src/python \
26+
&& ./configure --enable-shared --enable-unicode=ucs4 \
27+
&& make -j$(nproc) \
28+
&& make install \
29+
&& ldconfig \
30+
&& curl -SL 'https://bootstrap.pypa.io/get-pip.py' | python3 \
31+
&& pip install --upgrade pip==$PYTHON_PIP_VERSION \
32+
&& find /usr/local \
33+
\( -type d -a -name test -o -name tests \) \
34+
-o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
35+
-exec rm -rf '{}' + \
36+
&& rm -rf /usr/src/python
37+
38+
# make some useful symlinks that are expected to exist
39+
RUN cd /usr/local/bin \
40+
&& ln -s idle3 idle \
41+
&& ln -s pydoc3 pydoc \
42+
&& ln -s python3 python \
43+
&& ln -s python-config3 python-config
44+
45+
CMD ["python3"]

3.2/onbuild/Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM python:3.2
2+
3+
RUN mkdir -p /usr/src/app
4+
WORKDIR /usr/src/app
5+
6+
ONBUILD COPY requirements.txt /usr/src/app/
7+
ONBUILD RUN pip install -r requirements.txt
8+
9+
ONBUILD COPY . /usr/src/app

3.2/slim/Dockerfile

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
FROM debian:jessie
2+
3+
# remove several traces of debian python
4+
RUN apt-get purge -y python.*
5+
6+
# http://bugs.python.org/issue19846
7+
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
8+
ENV LANG C.UTF-8
9+
10+
RUN apt-get update && apt-get install -y --no-install-recommends \
11+
ca-certificates \
12+
libsqlite3-0 \
13+
libssl1.0.0 \
14+
&& rm -rf /var/lib/apt/lists/*
15+
16+
# gpg: key 36580288: public key "Georg Brandl (Python release signing key) <georg@python.org>" imported
17+
RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 26DEA9D4613391EF3E25C9FF0A5B101836580288
18+
19+
ENV PYTHON_VERSION 3.2.6
20+
21+
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
22+
ENV PYTHON_PIP_VERSION 7.0.0
23+
24+
RUN set -x \
25+
&& buildDeps='curl gcc libbz2-dev libc6-dev libsqlite3-dev libssl-dev make xz-utils zlib1g-dev' \
26+
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
27+
&& mkdir -p /usr/src/python \
28+
&& curl -SL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \
29+
&& curl -SL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz.asc" -o python.tar.xz.asc \
30+
&& gpg --verify python.tar.xz.asc \
31+
&& tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \
32+
&& rm python.tar.xz* \
33+
&& cd /usr/src/python \
34+
&& ./configure --enable-shared --enable-unicode=ucs4 \
35+
&& make -j$(nproc) \
36+
&& make install \
37+
&& ldconfig \
38+
&& curl -SL 'https://bootstrap.pypa.io/get-pip.py' | python3 \
39+
&& pip install --upgrade pip==$PYTHON_PIP_VERSION \
40+
&& find /usr/local \
41+
\( -type d -a -name test -o -name tests \) \
42+
-o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
43+
-exec rm -rf '{}' + \
44+
&& apt-get purge -y --auto-remove $buildDeps \
45+
&& rm -rf /usr/src/python
46+
47+
# make some useful symlinks that are expected to exist
48+
RUN cd /usr/local/bin \
49+
&& ln -s idle3 idle \
50+
&& ln -s pydoc3 pydoc \
51+
&& ln -s python3 python \
52+
&& ln -s python-config3 python-config
53+
54+
CMD ["python3"]

3.2/wheezy/Dockerfile

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
FROM buildpack-deps:wheezy
2+
3+
# remove several traces of debian python
4+
RUN apt-get purge -y python.*
5+
6+
# http://bugs.python.org/issue19846
7+
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
8+
ENV LANG C.UTF-8
9+
10+
# gpg: key 36580288: public key "Georg Brandl (Python release signing key) <georg@python.org>" imported
11+
RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 26DEA9D4613391EF3E25C9FF0A5B101836580288
12+
13+
ENV PYTHON_VERSION 3.2.6
14+
15+
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
16+
ENV PYTHON_PIP_VERSION 7.0.0
17+
18+
RUN set -x \
19+
&& mkdir -p /usr/src/python \
20+
&& curl -SL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \
21+
&& curl -SL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz.asc" -o python.tar.xz.asc \
22+
&& gpg --verify python.tar.xz.asc \
23+
&& tar -xJC /usr/src/python --strip-components=1 -f python.tar.xz \
24+
&& rm python.tar.xz* \
25+
&& cd /usr/src/python \
26+
&& ./configure --enable-shared --enable-unicode=ucs4 \
27+
&& make -j$(nproc) \
28+
&& make install \
29+
&& ldconfig \
30+
&& curl -SL 'https://bootstrap.pypa.io/get-pip.py' | python3 \
31+
&& pip install --upgrade pip==$PYTHON_PIP_VERSION \
32+
&& find /usr/local \
33+
\( -type d -a -name test -o -name tests \) \
34+
-o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
35+
-exec rm -rf '{}' + \
36+
&& rm -rf /usr/src/python
37+
38+
# make some useful symlinks that are expected to exist
39+
RUN cd /usr/local/bin \
40+
&& ln -s idle3 idle \
41+
&& ln -s pydoc3 pydoc \
42+
&& ln -s python3 python \
43+
&& ln -s python-config3 python-config
44+
45+
CMD ["python3"]

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy