Skip to content

Commit 652ad24

Browse files
committed
Install explicit version of pip and clean up tree
1 parent e9abae1 commit 652ad24

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

2.7/Dockerfile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ RUN gpg2 --keyserver pool.sks-keyservers.net --recv-keys C01E1CAD5EA2C4F0B8E3571
1414

1515
ENV PYTHON_VERSION 2.7.9
1616

17+
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
18+
ENV PYTHON_PIP_VERSION 7.0.1
19+
1720
RUN tce-load -wic \
1821
bzip2-dev \
1922
flex \
@@ -86,7 +89,12 @@ RUN tce-load -wic \
8689
done \
8790
&& sudo rm -f /usr/bin/file \
8891
&& sudo /sbin/ldconfig \
89-
&& rm -rf /tmp/tce/optional/*
92+
&& rm -rf /tmp/tce/optional/* \
93+
&& curl -SL 'https://bootstrap.pypa.io/get-pip.py' | sudo python2 \
94+
&& sudo pip install --upgrade pip==$PYTHON_PIP_VERSION \
95+
&& sudo find /usr/local \( -type f -a -name '*.pyc' -o -name '*.pyo' \) -exec rm -rf '{}' + \
96+
&& find /usr/local \( -type d -a -name test -o -name tests \) | sudo xargs rm -rf \
97+
&& sudo rm -rf /usr/src/python
9098

9199
# Instructions after here are run with 'root' user
92100
USER root

3.4/Dockerfile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ RUN gpg2 --keyserver pool.sks-keyservers.net --recv-keys 97FC712E4C024BBEA48A61E
1414

1515
ENV PYTHON_VERSION 3.4.3
1616

17+
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
18+
ENV PYTHON_PIP_VERSION 7.0.1
19+
1720
RUN tce-load -wic \
1821
bzip2-dev \
1922
flex \
@@ -88,15 +91,19 @@ RUN tce-load -wic \
8891
done \
8992
&& sudo rm -f /usr/bin/file \
9093
&& sudo /sbin/ldconfig \
91-
&& rm -rf /tmp/tce/optional/*
94+
&& rm -rf /tmp/tce/optional/* \
95+
&& curl -SL 'https://bootstrap.pypa.io/get-pip.py' | sudo python3 \
96+
&& sudo pip install --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
92100

93101
# Instructions after here are run with 'root' user
94102
USER root
95103

96104
RUN cd /usr/local/bin \
97105
&& ln -s easy_install-3.4 easy_install \
98106
&& ln -s idel3 idle \
99-
&& ln -s pip3 pip \
100107
&& ln -s pydoc3 pydoc \
101108
&& ln -s python3 python \
102109
&& ln -s python3-config python-config

0 commit comments

Comments
 (0)