18 lines
796 B
Docker
18 lines
796 B
Docker
FROM ubuntu:22.04
|
|
RUN <<EOF
|
|
apt-get update
|
|
apt-get install -y python3 python3-pip python3-dev python3-wheel build-essential git wget
|
|
wget -O /usr/local/bin/bazel "https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-amd64" && chmod +x /usr/local/bin/bazel
|
|
git clone https://github.com/tensorflow/tensorflow.git
|
|
EOF
|
|
RUN pip3 install -U --user pip numpy wheel packaging requests
|
|
RUN pip3 install -U --user keras_preprocessing --no-deps
|
|
WORKDIR /tensorflow
|
|
RUN git checkout r2.12
|
|
RUN yes "" | CC_OPT_FLAGS="-march=native" ./configure
|
|
RUN bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package
|
|
RUN ./bazel-bin/tensorflow/tools/pip_package/build_pip_package /tensorflow_pkg
|
|
WORKDIR /tensorflow_pkg
|
|
RUN pip3 install tensorflow*.whl
|
|
CMD ["/bin/bash", "-l"]
|