-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d9d7eb1
commit 8507216
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
ARG PYTHON_VERSION=3.6.8-slim-stretch | ||
|
||
FROM python:${PYTHON_VERSION} as tensorflow-builder | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y \ | ||
build-essential \ | ||
curl \ | ||
unzip \ | ||
python3-dev | ||
|
||
RUN echo "startup --batch" >>/etc/bazel.bazelrc | ||
RUN echo "build --spawn_strategy=standalone --genrule_strategy=standalone" \ | ||
>>/etc/bazel.bazelrc | ||
ENV BAZEL_VERSION 0.18.0 | ||
WORKDIR / | ||
RUN mkdir /bazel && \ | ||
cd /bazel && \ | ||
curl -fSsL -O https://github.com/bazelbuild/bazel/releases/download/$BAZEL_VERSION/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh && \ | ||
curl -fSsL -o LICENSE.txt https://raw.githubusercontent.com/bazelbuild/bazel/master/LICENSE && \ | ||
chmod +x bazel-*.sh && \ | ||
./bazel-$BAZEL_VERSION-installer-linux-x86_64.sh && \ | ||
cd / && \ | ||
rm -f /bazel/bazel-$BAZEL_VERSION-installer-linux-x86_64.sh | ||
|
||
ENV TENSORFLOW_VERSION 1.12.0 | ||
ENV CI_BUILD_PYTHON python3 | ||
RUN pip install numpy keras_applications keras_preprocessing | ||
|
||
RUN curl -fSsL -O https://github.com/tensorflow/tensorflow/archive/v$TENSORFLOW_VERSION.tar.gz && \ | ||
tar xvf v$TENSORFLOW_VERSION.tar.gz | ||
|
||
WORKDIR /tensorflow-$TENSORFLOW_VERSION | ||
|
||
RUN mkdir /wheels && \ | ||
tensorflow/tools/ci_build/builds/configured CPU \ | ||
bazel build -c opt --cxxopt="-D_GLIBCXX_USE_CXX11_ABI=0" \ | ||
tensorflow/tools/pip_package:build_pip_package && \ | ||
bazel-bin/tensorflow/tools/pip_package/build_pip_package /wheels |