48 lines
1.6 KiB
Docker
48 lines
1.6 KiB
Docker
# 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 2010 compliant TensorFlow pip package with
|
|
# cuda-clang.
|
|
#
|
|
# To build, first build the manylinux2010 toolchain docker image and tag it,
|
|
# then build the TensorFlow docker image using the tagged image as base.
|
|
#
|
|
# $ docker build -f Dockerfile.rbe.cuda10.0-cudnn7-ubuntu16.04-manylinux2010 \
|
|
# --tag "local-manylinux-toolchain" .
|
|
# $ docker build -f Dockerfile.cuda-clang .
|
|
|
|
FROM local-manylinux-toolchain
|
|
|
|
WORKDIR /
|
|
RUN git clone https://github.com/tensorflow/tensorflow
|
|
|
|
WORKDIR /tensorflow
|
|
ENV TF_NEED_GCP=1 \
|
|
TF_NEED_HDFS=1 \
|
|
TF_NEED_CUDA=1 \
|
|
TF_CUDA_CLANG=1 \
|
|
PATH=/dt7/usr/bin:$PATH \
|
|
PYTHON_BIN_PATH=/usr/bin/python3.6 \
|
|
CLANG_CUDA_COMPILER_PATH=/clang_${CLANG_VERSION}/bin/clang
|
|
|
|
ADD cuda-clang.patch cuda-clang.patch
|
|
RUN patch -p1 < cuda-clang.patch
|
|
|
|
RUN yes "" | ./configure
|
|
|
|
RUN bazel build --config=opt tensorflow/tools/pip_package:build_pip_package
|
|
|
|
RUN ./bazel-bin/tensorflow/tools/pip_package/build_pip_package /tf-wheel
|