@@ -53,6 +53,7 @@ RUN apt-get update \
53
53
libssl-dev \
54
54
libsqlite3-dev \
55
55
portaudio19-dev \
56
+ python3-distutils \
56
57
pkg-config \
57
58
redis-server \
58
59
software-properties-common \
@@ -111,54 +112,9 @@ RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
111
112
&& rm -rf /var/lib/apt/lists/* \
112
113
&& rm -f /var/cache/apt/archives/*.deb
113
114
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
162
118
163
119
# Install "virtualenv", since the vast majority of users of this image
164
120
# will want it.
@@ -167,7 +123,7 @@ RUN pip install --no-cache-dir virtualenv
167
123
# Setup Cloud SDK
168
124
ENV CLOUD_SDK_VERSION 339.0.0
169
125
# Use system python for cloud sdk.
170
- ENV CLOUDSDK_PYTHON python3.6
126
+ ENV CLOUDSDK_PYTHON python3.8
171
127
RUN wget https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-$CLOUD_SDK_VERSION-linux-x86_64.tar.gz
172
128
RUN tar xzf google-cloud-sdk-$CLOUD_SDK_VERSION-linux-x86_64.tar.gz
173
129
RUN /google-cloud-sdk/install.sh
@@ -191,4 +147,4 @@ RUN useradd -d /h -u ${UID} ${USERNAME}
191
147
# Allow nopasswd sudo
192
148
RUN echo "${USERNAME} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
193
149
194
- CMD ["python3.6 " ]
150
+ CMD ["python3.8 " ]
0 commit comments