# Copyright 2026 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. # ============================================================================== # Dockerfile to build a manylinux 2014/2014 compliant cross-compiler. # # Builds a devtoolset-7 environment with manylinux2014 compatible # glibc (2.12) and libstdc++ (4.4) in /dt7. # # Builds a devtoolset-9 environment with manylinux2014 compatible # glibc (2.17) and libstdc++ (4.8) in /dt9. # # To build a new version, run: # $ docker build -f Dockerfile.local-toolchain-ubuntu20.04-manylinux2014 \ # --tag "local-toolchain-ubuntu20.04-manylinux2014" . FROM ubuntu:20.04 as local-toolchain-ubuntu20.04-manylinux2014 ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install -y \ cpio \ file \ flex \ g++ \ make \ patch \ rpm2cpio \ unar \ wget \ xz-utils \ && \ rm -rf /var/lib/apt/lists/* ADD devtoolset/fixlinks.sh fixlinks.sh ADD devtoolset/build_devtoolset.sh build_devtoolset.sh ADD devtoolset/rpm-patch.sh rpm-patch.sh # Set up a sysroot for glibc 2.12 / libstdc++ 4.4 / devtoolset-7 in /dt7. RUN /build_devtoolset.sh devtoolset-7 /dt7 # Set up a sysroot for glibc 2.17 / libstdc++ 4.8 / devtoolset-9 in /dt9. RUN /build_devtoolset.sh devtoolset-9 /dt9