Skip to content

Commit 8b58f9b

Browse files
authored
[Dockerfile] Add DeepRec release image dockerfile. (#976)
Signed-off-by: candy.dc <candy.dc@alibaba-inc.com>
1 parent 8d40244 commit 8b58f9b

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# build DeepRec & estimator wheel
2+
FROM alideeprec/deeprec-base:deeprec-base-cpu-py38-ubuntu20.04 AS deeprec_build
3+
4+
ARG TF_COMMIT=deeprec2402
5+
6+
RUN mkdir -p /src
7+
RUN wget -nv -O /src/install_bazel.sh \
8+
http://pythonrun.oss-cn-zhangjiakou.aliyuncs.com/bazel-0.26.1-installer-linux-x86_64.sh && \
9+
bash /src/install_bazel.sh
10+
11+
RUN git clone https://github.com/DeepRec-AI/DeepRec.git /src/DeepRec && \
12+
cd /src/DeepRec && \
13+
git checkout ${TF_COMMIT}
14+
RUN cd /src/DeepRec && \
15+
yes "" | bash ./configure || true && \
16+
bazel build -c opt --config=opt //tensorflow/tools/pip_package:build_pip_package && \
17+
bazel-bin/tensorflow/tools/pip_package/build_pip_package /src/
18+
19+
RUN pip install /src/tensorflow-1.15.5+${TF_COMMIT}-cp38-cp38-linux_x86_64.whl
20+
21+
RUN git clone https://github.com/DeepRec-AI/estimator.git /src/estimator && \
22+
cd /src/estimator && \
23+
git checkout ${TF_COMMIT}
24+
RUN cd /src/estimator && \
25+
bazel build //tensorflow_estimator/tools/pip_package:build_pip_package && \
26+
bazel-bin/tensorflow_estimator/tools/pip_package/build_pip_package /src/
27+
28+
# build DeeepRec release image
29+
FROM alideeprec/deeprec-base:deeprec-base-cpu-py38-ubuntu20.04
30+
COPY --from=deeprec_build /src/*.whl /
31+
RUN pip install /tensorflow-1.15.5+${TF_COMMIT}-cp38-cp38-linux_x86_64.whl tensorflow_estimator-1.15.2+${TF_COMMIT}-py2.py3-none-any.whl
32+
RUN rm -f /tensorflow-1.15.5+${TF_COMMIT}-cp38-cp38-linux_x86_64.whl /tensorflow_estimator-1.15.2+${TF_COMMIT}-py2.py3-none-any.whl

0 commit comments

Comments
 (0)