8000 For testing purposes · HichemELB/python-docs-samples@c495b75 · GitHub
[go: up one dir, main page]

Skip to content

Commit c495b75

Browse files
committed
For testing purposes
1 parent e3fb3cf commit c495b75

File tree

2 files changed

+6
-103
lines changed

2 files changed

+6
-103
lines changed

.kokoro/docker/Dockerfile

Lines changed: 6 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ RUN apt-get update \
5353
libssl-dev \
5454
libsqlite3-dev \
5555
portaudio19-dev \
56+
python3-distutils \
5657
pkg-config \
5758
redis-server \
5859
software-properties-common \
@@ -111,54 +112,9 @@ RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
111112
&& rm -rf /var/lib/apt/lists/* \
112113
&& rm -f /var/cache/apt/archives/*.deb
113114

114-
COPY fetch_gpg_keys.sh /tmp
115-
# Install the desired versions of Python.
116-
RUN set -ex \
117-
& 8000 amp;& export GNUPGHOME="$(mktemp -d)" \
118-
&& echo "disable-ipv6" >> "${GNUPGHOME}/dirmngr.conf" \
119-
&& /tmp/fetch_gpg_keys.sh \
120-
&& for PYTHON_VERSION in 2.7.18 3.6.13 3.7.10 3.8.8 3.9.2; do \
121-
wget --no-check-certificate -O python-${PYTHON_VERSION}.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz" \
122-
&& wget --no-check-certificate -O python-${PYTHON_VERSION}.tar.xz.asc "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz.asc" \
123-
&& gpg --batch --verify python-${PYTHON_VERSION}.tar.xz.asc python-${PYTHON_VERSION}.tar.xz \
124-
&& rm -r python-${PYTHON_VERSION}.tar.xz.asc \
125-
&& mkdir -p /usr/src/python-${PYTHON_VERSION} \
126-
&& tar -xJC /usr/src/python-${PYTHON_VERSION} --strip-components=1 -f python-${PYTHON_VERSION}.tar.xz \
127-
&& rm python-${PYTHON_VERSION}.tar.xz \
128-
&& cd /usr/src/python-${PYTHON_VERSION} \
129-
&& ./configure \
130-
--enable-shared \
131-
# This works only on Python 2.7 and throws a warning on every other
132-
# version, but seems otherwise harmless.
133-
--enable-unicode=ucs4 \
134-
--with-system-ffi \
135-
--without-ensurepip \
136-
&& make -j$(nproc) \
137-
&& make install \
138-
&& ldconfig \
139-
; done \
140-
&& rm -rf "${GNUPGHOME}" \
141-
&& rm -rf /usr/src/python* \
142-
&& rm -rf ~/.cache/
143-
144-
145-
# Install pip on Python 3.6 only.
146-
# If the environment variable is called "PIP_VERSION", pip explodes with
147-
# "ValueError: invalid truth value '<VERSION>'"
148-
ENV PYTHON_PIP_VERSION 20.2.4
149-
RUN wget --no-check-certificate -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \
150-
&& python3.6 /tmp/get-pip.py "pip==$PYTHON_PIP_VERSION" \
151-
# we use "--force-reinstall" for the case where the version of pip we're trying to install is the same as the version bundled with Python
152-
# ("Requirement already up-to-date: pip==8.1.2 in /usr/local/lib/python3.6/site-packages")
153-
# https://github.com/docker-library/python/pull/143#issuecomment-241032683
154-
&& pip3 install --no-cache-dir --upgrade --force-reinstall "pip==$PYTHON_PIP_VERSION" \
155-
# then we use "pip list" to ensure we don't have more than one pip version installed
156-
# https://github.com/docker-library/python/pull/100
157-
&& [ "$(pip list |tac|tac| awk -F '[ ()]+' '$1 == "pip" { print $2; exit }')" = "$PYTHON_PIP_VERSION" ]
158-
159-
# Ensure Pip for python3
160-
RUN python3 /tmp/get-pip.py
161-
RUN rm /tmp/get-pip.py
115+
RUN wget -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \
116+
&& python3.8 /tmp/get-pip.py \
117+
&& rm /tmp/get-pip.py
162118

163119
# Install "virtualenv", since the vast majority of users of this image
164120
# will want it.
@@ -167,7 +123,7 @@ RUN pip install --no-cache-dir virtualenv
167123
# Setup Cloud SDK
168124
ENV CLOUD_SDK_VERSION 339.0.0
169125
# Use system python for cloud sdk.
170-
ENV CLOUDSDK_PYTHON python3.6
126+
ENV CLOUDSDK_PYTHON python3.8
171127
RUN wget https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-$CLOUD_SDK_VERSION-linux-x86_64.tar.gz
172128
RUN tar xzf google-cloud-sdk-$CLOUD_SDK_VERSION-linux-x86_64.tar.gz
173129
RUN /google-cloud-sdk/install.sh
@@ -191,4 +147,4 @@ RUN useradd -d /h -u ${UID} ${USERNAME}
191147
# Allow nopasswd sudo
192148
RUN echo "${USERNAME} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
193149

194-
CMD ["python3.6"]
150+
CMD ["python3.8"]

.kokoro/docker/fetch_gpg_keys.sh

Lines changed: 0 additions & 53 deletions
This file was deleted.

0 commit comments

Comments
 (0)
0