Skip to content

Commit 12105a2

Browse files
committed
Install explicit version of "pip"
1 parent 3575b03 commit 12105a2

File tree

10 files changed

+42
-4
lines changed

10 files changed

+42
-4
lines changed

2.7/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys C01E1CAD5EA2C4F0B8E35
1212

1313
ENV PYTHON_VERSION 2.7.9
1414

15+
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
16+
ENV PYTHON_PIP_VERSION 6.1.1
17+
1518
RUN set -x \
1619
&& mkdir -p /usr/src/python \
1720
&& curl -SL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \
@@ -25,6 +28,7 @@ RUN set -x \
2528
&& make install \
2629
&& ldconfig \
2730
&& curl -SL 'https://bootstrap.pypa.io/get-pip.py' | python2 \
31+
&& pip install --upgrade pip==$PYTHON_PIP_VERSION \
2832
&& find /usr/local \
2933
\( -type d -a -name test -o -name tests \) \
3034
-o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \

2.7/slim/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys C01E1CAD5EA2C4F0B8E35
1818

1919
ENV PYTHON_VERSION 2.7.9
2020

21+
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
22+
ENV PYTHON_PIP_VERSION 6.1.1
23+
2124
RUN set -x \
2225
&& buildDeps='curl gcc libbz2-dev libc6-dev libsqlite3-dev libssl-dev make xz-utils zlib1g-dev' \
2326
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
@@ -33,6 +36,7 @@ RUN set -x \
3336
&& make install \
3437
&& ldconfig \
3538
&& curl -SL 'https://bootstrap.pypa.io/get-pip.py' | python2 \
39+
&& pip install --upgrade pip==$PYTHON_PIP_VERSION \
3640
&& find /usr/local \
3741
\( -type d -a -name test -o -name tests \) \
3842
-o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \

2.7/wheezy/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys C01E1CAD5EA2C4F0B8E35
1212

1313
ENV PYTHON_VERSION 2.7.9
1414

15+
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
16+
ENV PYTHON_PIP_VERSION 6.1.1
17+
1518
RUN set -x \
1619
&& mkdir -p /usr/src/python \
1720
&& curl -SL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \
@@ -25,6 +28,7 @@ RUN set -x \
2528
&& make install \
2629
&& ldconfig \
2730
&& curl -SL 'https://bootstrap.pypa.io/get-pip.py' | python2 \
31+
&& pip install --upgrade pip==$PYTHON_PIP_VERSION \
2832
&& find /usr/local \
2933
\( -type d -a -name test -o -name tests \) \
3034
-o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \

3.3/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 26DEA9D4613391EF3E25C
1212

1313
ENV PYTHON_VERSION 3.3.6
1414

15+
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
16+
ENV PYTHON_PIP_VERSION 6.1.1
17+
1518
RUN set -x \
1619
&& mkdir -p /usr/src/python \
1720
&& curl -SL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \
@@ -25,6 +28,7 @@ RUN set -x \
2528
&& make install \
2629
&& ldconfig \
2730
&& curl -SL 'https://bootstrap.pypa.io/get-pip.py' | python3 \
31+
&& pip install --upgrade pip==$PYTHON_PIP_VERSION \
2832
&& find /usr/local \
2933
\( -type d -a -name test -o -name tests \) \
3034
-o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \

3.3/slim/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 26DEA9D4613391EF3E25C
1818

1919
ENV PYTHON_VERSION 3.3.6
2020

21+
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
22+
ENV PYTHON_PIP_VERSION 6.1.1
23+
2124
RUN set -x \
2225
&& buildDeps='curl gcc libbz2-dev libc6-dev libsqlite3-dev libssl-dev make xz-utils zlib1g-dev' \
2326
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
@@ -33,6 +36,7 @@ RUN set -x \
3336
&& make install \
3437
&& ldconfig \
3538
&& curl -SL 'https://bootstrap.pypa.io/get-pip.py' | python3 \
39+
&& pip install --upgrade pip==$PYTHON_PIP_VERSION \
3640
&& find /usr/local \
3741
\( -type d -a -name test -o -name tests \) \
3842
-o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \

3.3/wheezy/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 26DEA9D4613391EF3E25C
1212

1313
ENV PYTHON_VERSION 3.3.6
1414

15+
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
16+
ENV PYTHON_PIP_VERSION 6.1.1
17+
1518
RUN set -x \
1619
&& mkdir -p /usr/src/python \
1720
&& curl -SL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \
@@ -25,6 +28,7 @@ RUN set -x \
2528
&& make install \
2629
&& ldconfig \
2730
&& curl -SL 'https://bootstrap.pypa.io/get-pip.py' | python3 \
31+
&& pip install --upgrade pip==$PYTHON_PIP_VERSION \
2832
&& find /usr/local \
2933
\( -type d -a -name test -o -name tests \) \
3034
-o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \

3.4/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 97FC712E4C024BBEA48A6
1212

1313
ENV PYTHON_VERSION 3.4.3
1414

15+
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
16+
ENV PYTHON_PIP_VERSION 6.1.1
17+
1518
RUN set -x \
1619
&& mkdir -p /usr/src/python \
1720
&& curl -SL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \
@@ -24,6 +27,7 @@ RUN set -x \
2427
&& make -j$(nproc) \
2528
&& make install \
2629
&& ldconfig \
30+
&& pip3 install --upgrade pip==$PYTHON_PIP_VERSION \
2731
&& find /usr/local \
2832
\( -type d -a -name test -o -name tests \) \
2933
-o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
@@ -34,7 +38,6 @@ RUN set -x \
3438
RUN cd /usr/local/bin \
3539
&& ln -s easy_install-3.4 easy_install \
3640
&& ln -s idle3 idle \
37-
&& ln -s pip3 pip \
3841
&& ln -s pydoc3 pydoc \
3942
&& ln -s python3 python \
4043
&& ln -s python-config3 python-config

3.4/slim/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 97FC712E4C024BBEA48A6
1818

1919
ENV PYTHON_VERSION 3.4.3
2020

21+
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
22+
ENV PYTHON_PIP_VERSION 6.1.1
23+
2124
RUN set -x \
2225
&& buildDeps='curl gcc libbz2-dev libc6-dev libsqlite3-dev libssl-dev make xz-utils zlib1g-dev' \
2326
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
@@ -32,6 +35,7 @@ RUN set -x \
3235
&& make -j$(nproc) \
3336
&& make install \
3437
&& ldconfig \
38+
&& pip3 install --upgrade pip==$PYTHON_PIP_VERSION \
3539
&& find /usr/local \
3640
\( -type d -a -name test -o -name tests \) \
3741
-o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
@@ -43,7 +47,6 @@ RUN set -x \
4347
RUN cd /usr/local/bin \
4448
&& ln -s easy_install-3.4 easy_install \
4549
&& ln -s idle3 idle \
46-
&& ln -s pip3 pip \
4750
&& ln -s pydoc3 pydoc \
4851
&& ln -s python3 python \
4952
&& ln -s python-config3 python-config

3.4/wheezy/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 97FC712E4C024BBEA48A6
1212

1313
ENV PYTHON_VERSION 3.4.3
1414

15+
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
16+
ENV PYTHON_PIP_VERSION 6.1.1
17+
1518
RUN set -x \
1619
&& mkdir -p /usr/src/python \
1720
&& curl -SL "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz" -o python.tar.xz \
@@ -24,6 +27,7 @@ RUN set -x \
2427
&& make -j$(nproc) \
2528
&& make install \
2629
&& ldconfig \
30+
&& pip3 install --upgrade pip==$PYTHON_PIP_VERSION \
2731
&& find /usr/local \
2832
\( -type d -a -name test -o -name tests \) \
2933
-o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
@@ -34,7 +38,6 @@ RUN set -x \
3438
RUN cd /usr/local/bin \
3539
&& ln -s easy_install-3.4 easy_install \
3640
&& ln -s idle3 idle \
37-
&& ln -s pip3 pip \
3841
&& ln -s pydoc3 pydoc \
3942
&& ln -s python3 python \
4043
&& ln -s python-config3 python-config

update.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,19 @@ if [ ${#versions[@]} -eq 0 ]; then
99
fi
1010
versions=( "${versions[@]%/}" )
1111

12+
pipVersion="$(curl -sSL 'https://pypi.python.org/pypi/pip/json' | awk -F '"' '$2 == "version" { print $4 }')"
13+
1214
for version in "${versions[@]}"; do
1315
# <span class="release-number"><a href="/downloads/release/python-278/">Python 2.7.8</a></span>
1416
# <span class="release-number"><a href="/downloads/release/python-341/">Python 3.4.1</a></span>
1517
fullVersion="$(curl -sSL 'https://www.python.org/downloads/' | awk -F 'Python |</a>' '/<span class="release-number"><a[^>]+>Python '"$version"'./ { print $2 }' | grep -v 'rc' | sort -V | tail -1)"
1618
# TODO figure out a better want to handle RCs than just filtering them out wholesale
1719
(
1820
set -x
19-
sed -ri 's/^(ENV PYTHON_VERSION) .*/\1 '"$fullVersion"'/' "$version"/{,slim/,wheezy/}Dockerfile
21+
sed -ri '
22+
s/^(ENV PYTHON_VERSION) .*/\1 '"$fullVersion"'/;
23+
s/^(ENV PYTHON_PIP_VERSION) .*/\1 '"$pipVersion"'/;
24+
' "$version"/{,slim/,wheezy/}Dockerfile
2025
sed -ri 's/^(FROM python):.*/\1:'"$fullVersion"'/' "$version/onbuild/Dockerfile"
2126
)
2227
done

0 commit comments

Comments
 (0)