-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile.amd64
45 lines (36 loc) · 1.58 KB
/
Dockerfile.amd64
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
ARG ARCH=
ARG PYTHON_VERSION=3.8.6-slim-buster
# FROM ${ARCH}debian:buster-slim
FROM ${ARCH}python:${PYTHON_VERSION} as tensorflow-builder
ARG TENSORFLOW_VERSION
ARG BAZEL_VERSION
ARG NUMPY_VERSION
RUN apt-get update && \
apt-get install -y \
build-essential \
curl \
git \
python-dev \
unzip
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
RUN echo "numpy==${NUMPY_VERSION}"
# Up-to-date pip dependencies to be found at https://www.tensorflow.org/install/source
RUN pip install -U pip numpy==${NUMPY_VERSION} wheel && \
pip install -U keras_preprocessing --no-deps
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}
# The cxx options configured here have been tweaked and tested to work on older hardware such as Celeron processors
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