Skip to content
Open
10 changes: 8 additions & 2 deletions tensorflow/tools/ci_build/Dockerfile.cpu-py38
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,16 @@ RUN apt -y install gcc-7 g++-7
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 700 \
--slave /usr/bin/g++ g++ /usr/bin/g++-7

# The following line installs the Python 3.8 cross-compilation toolchain.
RUN /install/install_pi_python3x_toolchain.sh "3.8"
# Install Python 3.8
# libffi-dev is needed for ctypes module of python3.8
RUN apt install libffi-dev
# libsqlite3-dev is needed for module named '_sqlite3'
RUN apt install libsqlite3-dev
RUN chmod 777 /install/install_python38.sh
RUN /install/install_python38.sh
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 0
RUN python3 -V
RUN /install/install_pip_packages_by_version.sh pip3

RUN /install/install_bazel.sh
RUN /install/install_proto3.sh
Expand Down
25 changes: 25 additions & 0 deletions tensorflow/tools/ci_build/install/install_python38.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================

cd /usr/src
wget https://www.python.org/ftp/python/3.8.10/Python-3.8.10.tgz
tar xzf Python-3.8.10.tgz
cd Python-3.8.10
./configure --enable-optimizations --with-ensurepip=install --prefix=/usr/
make altinstall
rm /usr/src/Python-3.8.10.tgz
rm -rf /usr/src/Python-3.8.10