Skip to content

Commit 3c1cbab

Browse files
committed
Bump up Python version to 3.5.0
1 parent d6d1788 commit 3c1cbab

File tree

7 files changed

+152
-5
lines changed

7 files changed

+152
-5
lines changed

3.4/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,3 @@ build:
1010

1111
clean:
1212
docker images $(IMAGE_NAME) | grep -q $(IMAGE_TAG) && docker rmi $(IMAGE_NAME):$(IMAGE_TAG) || true
13-
docker images $(IMAGE_NAME) | grep -q latest && docker rmi $(IMAGE_NAME):latest || true

3.5/Dockerfile

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
FROM tatsushid/tinycore:6.4-x86_64
2+
3+
# Instructions are run with 'tc' user
4+
5+
# http://bugs.python.org/issue19846
6+
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
7+
ENV LANG C.UTF-8
8+
9+
RUN tce-load -wic gnupg curl \
10+
&& rm -rf /tmp/tce/optional/*
11+
12+
# gpg: key F73C700D: public key "Larry Hastings <larry@hastings.org>" imported
13+
RUN gpg2 --keyserver pool.sks-keyservers.net --recv-keys 97FC712E4C024BBEA48A61ED3A5CA953F73C700D
14+
15+
ENV PYTHON_VERSION 3.5.0
16+
17+
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
18+
ENV PYTHON_PIP_VERSION 7.1.2
19+
20+
RUN tce-load -wic \
21+
bzip2-dev \
22+
flex \
23+
file \
24+
gcc \
25+
make \
26+
linux-3.16.2_api_headers \
27+
glibc_base-dev \
28+
openssl-dev \
29+
gdbm-dev \
30+
ncurses-dev \
31+
readline-dev \
32+
sqlite3-dev \
33+
liblzma-dev \
34+
zlib_base-dev \
35+
tk-dev \
36+
libX11-dev \
37+
libXss \
38+
xorg-proto \
39+
&& sudo ln -s /usr/local/bin/file /usr/bin/file \
40+
&& cd /tmp \
41+
&& curl -SL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \
42+
&& curl -SL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz.asc" -o python.tar.xz.asc \
43+
&& gpg2 --verify python.tar.xz.asc \
44+
&& rm python.tar.xz.asc \
45+
&& tar -xJf python.tar.xz \
46+
&& rm python.tar.xz \
47+
&& cd "/tmp/Python-$PYTHON_VERSION" \
48+
&& ./configure --enable-shared \
49+
&& make \
50+
&& mkdir tmp_install \
51+
&& make install DESTDIR=tmp_install \
52+
&& for F in `find tmp_install | xargs file | grep "executable" | grep ELF | grep "not stripped" | cut -f 1 -d :`; do \
53+
[ -f $F ] && strip --strip-unneeded $F; \
54+
done \
55+
&& for F in `find tmp_install | xargs file | grep "shared object" | grep ELF | grep "not stripped" | cut -f 1 -d :`; do \
56+
[ -f $F ] && if [ ! -w $F ]; then chmod u+w $F && strip -g $F && chmod u-w $F; else strip -g $F; fi \
57+
done \
58+
&& for F in `find tmp_install | xargs file | grep "current ar archive" | cut -f 1 -d :`; do \
59+
[ -f $F ] && strip -g $F; \
60+
done \
61+
&& find tmp_install \( -type f -a -name '*.pyc' -o -name '*.pyo' \) -exec rm -rf '{}' + \
62+
&& find tmp_install \( -type d -a -name test -o -name tests \) | xargs rm -rf \
63+
&& $(cd tmp_install; sudo cp -R . /) \
64+
&& rm -rf "/tmp/Python-$PYTHON_VERSION" \
65+
&& cd /tmp/tce/optional \
66+
&& for PKG in `ls *-dev.tcz`; do \
67+
echo "Removing $PKG files"; \
68+
for F in `unsquashfs -l $PKG | grep squashfs-root | sed -e 's/squashfs-root//'`; do \
69+
[ -f $F -o -L $F ] && sudo rm -f $F; \
70+
done; \
71+
INSTALLED=$(echo -n $PKG | sed -e s/.tcz//); \
72+
sudo rm -f /usr/local/tce.installed/$INSTALLED; \
73+
done \
74+
&& for PKG in binutils.tcz \
75+
cloog.tcz \
76+
flex.tcz \
77+
file.tcz \
78+
gcc.tcz \
79+
gcc_libs.tcz \
80+
linux-3.16.2_api_headers.tcz \
81+
make.tcz \
82+
sqlite3-bin.tcz \
83+
xz.tcz \
84+
xorg-proto.tcz; do \
85+
echo "Removing $PKG files"; \
86+
for F in `unsquashfs -l $PKG | grep squashfs-root | sed -e 's/squashfs-root//'`; do \
87+
[ -f $F -o -L $F ] && sudo rm -f $F; \
88+
done; \
89+
INSTALLED=$(echo -n $PKG | sed -e s/.tcz//); \
90+
sudo rm -f /usr/local/tce.installed/$INSTALLED; \
91+
done \
92+
&& sudo rm -f /usr/bin/file \
93+
&& sudo /sbin/ldconfig \
94+
&& rm -rf /tmp/tce/optional/* \
95+
&& curl -SL 'https://bootstrap.pypa.io/get-pip.py' | sudo python3 \
96+
&& sudo pip3 install --no-cache-dir --upgrade pip==$PYTHON_PIP_VERSION \
97+
&& sudo find /usr/local \( -type f -a -name '*.pyc' -o -name '*.pyo' \) -exec rm -rf '{}' + \
98+
&& find /usr/local \( -type d -a -name test -o -name tests \) | sudo xargs rm -rf \
99+
&& sudo rm -rf /usr/src/python
100+
101+
# Instructions after here are run with 'root' user
102+
USER root
103+
104+
RUN cd /usr/local/bin \
105+
&& ln -s easy_install-3.5 easy_install \
106+
&& ln -s idel3 idle \
107+
&& ln -s pydoc3 pydoc \
108+
&& ln -s python3 python \
109+
&& ln -s python3-config python-config
110+
111+
CMD ["python3"]

3.5/Makefile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
IMAGE_NAME := tinycore-python
2+
IMAGE_TAG := 3.5
3+
4+
.PHONY: all clean build
5+
6+
all: build
7+
8+
build:
9+
docker build -t $(IMAGE_NAME):$(IMAGE_TAG) .
10+
docker tag $(IMAGE_NAME):$(IMAGE_TAG) $(IMAGE_NAME):latest
11+
12+
clean:
13+
docker images $(IMAGE_NAME) | grep -q $(IMAGE_TAG) && docker rmi $(IMAGE_NAME):$(IMAGE_TAG) || true
14+
docker images $(IMAGE_NAME) | grep -q latest && docker rmi $(IMAGE_NAME):latest || true

3.5/onbuild/Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM tatsushid/tinycore-python:3.5
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 --no-cache-dir -r requirements.txt
8+
9+
ONBUILD COPY . /usr/src/app

3.5/onbuild/Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
IMAGE_NAME := tinycore-python
2+
IMAGE_TAG := 3.5-onbuild
3+
4+
.PHONY: all clean build
5+
6+
all: build
7+
8+
build:
9+
docker build -t $(IMAGE_NAME):$(IMAGE_TAG) .
10+
11+
clean:
12+
docker images $(IMAGE_NAME) | grep -q $(IMAGE_TAG) && docker rmi $(IMAGE_NAME):$(IMAGE_TAG) || true

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
PYTHON_DIRS := 3.4 2.7
2-
ONBUILD_DIRS := 3.4/onbuild 2.7/onbuild
1+
PYTHON_DIRS := 3.5 3.4 2.7
2+
ONBUILD_DIRS := 3.5/onbuild 3.4/onbuild 2.7/onbuild
33

44
.PHONY: all clean $(PYTHON_DIRS) $(ONBUILD_DIRS)
55

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ This provides a small but a fully functional [Python](https://www.python.org/) r
77

88
- [`2.7` (2.7/Dockerfile)](https://github.com/tatsushid/docker-tinycore-python/blob/master/2.7/Dockerfile)
99
- [`2.7-onbuild` (2.7/onbuild/Dockerfile)](https://github.com/tatsushid/docker-tinycore-python/blob/master/2.7/onbuild/Dockerfile)
10-
- [`3.4`, `latest` (3.4/Dockerfile)][Latest Dockerfile]
10+
- [`3.4` (3.4/Dockerfile)](https://github.com/tatsushid/docker-tinycore-python/blob/master/3.4/Dockerfile)
1111
- [`3.4-onbuild` (3.4/onbuild/Dockerfile)](https://github.com/tatsushid/docker-tinycore-python/blob/master/3.4/onbuild/Dockerfile)
12+
- [`3.5`, `latest` (3.5/Dockerfile)][Latest Dockerfile]
13+
- [`3.5-onbuild` (3.5/onbuild/Dockerfile)](https://github.com/tatsushid/docker-tinycore-python/blob/master/3.5/onbuild/Dockerfile)
1214

1315
## How to use this image
1416

@@ -18,4 +20,4 @@ This can be used in the same way as [Official Python Image](https://hub.docker.c
1820

1921
This doesn't contain a compiler, a linker and headers etc. so if you'd like to add a something C extension for Python, first you need to install them by `tce-load` command. Please refer this image's [Dockerfile][Latest Dockerfile] which is a good example of installing those packages.
2022

21-
[Latest Dockerfile]: https://github.com/tatsushid/docker-tinycore-python/blob/master/3.4/Dockerfile
23+
[Latest Dockerfile]: https://github.com/tatsushid/docker-tinycore-python/blob/master/3.5/Dockerfile

0 commit comments

Comments
 (0)