Skip to content

Commit 0cceede

Browse files
authored
Merge pull request #14332 from velconia/add_py3_to_gen_dockerfile
Change production mode Dockerfile to support python3
2 parents abe2092 + 37ee365 commit 0cceede

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

paddle/scripts/paddle_build.sh

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,24 @@ EOF
614614
CMD='"true"'
615615
fi
616616

617-
cat >> ${PADDLE_ROOT}/build/Dockerfile <<EOF
617+
if [ "$1" == "cp35-cp35m" ]; then
618+
cat >> ${PADDLE_ROOT}/build/Dockerfile <<EOF
619+
ADD python/dist/*.whl /
620+
# run paddle version to install python packages first
621+
RUN apt-get update && ${NCCL_DEPS}
622+
RUN apt-get install -y wget python3 python3-pip libgtk2.0-dev dmidecode python3-tk && \
623+
pip3 install opencv-python && pip3 install /*.whl; apt-get install -f -y && \
624+
apt-get clean -y && \
625+
rm -f /*.whl && \
626+
${PADDLE_VERSION} && \
627+
ldconfig
628+
${DOCKERFILE_CUDNN_DSO}
629+
${DOCKERFILE_CUBLAS_DSO}
630+
${DOCKERFILE_GPU_ENV}
631+
ENV NCCL_LAUNCH_MODE PARALLEL
632+
EOF
633+
else
634+
cat >> ${PADDLE_ROOT}/build/Dockerfile <<EOF
618635
ADD python/dist/*.whl /
619636
# run paddle version to install python packages first
620637
RUN apt-get update && ${NCCL_DEPS}
@@ -629,6 +646,8 @@ EOF
629646
${DOCKERFILE_GPU_ENV}
630647
ENV NCCL_LAUNCH_MODE PARALLEL
631648
EOF
649+
fi
650+
632651
if [[ ${WITH_GOLANG:-OFF} == "ON" ]]; then
633652
cat >> ${PADDLE_ROOT}/build/Dockerfile <<EOF
634653
ADD go/cmd/pserver/pserver /usr/bin/
@@ -703,7 +722,7 @@ function main() {
703722
build)
704723
cmake_gen ${PYTHON_ABI:-""}
705724
build
706-
gen_dockerfile
725+
gen_dockerfile ${PYTHON_ABI:-""}
707726
;;
708727
build_android)
709728
build_android
@@ -730,7 +749,7 @@ function main() {
730749
gen_html
731750
;;
732751
dockerfile)
733-
gen_dockerfile
752+
gen_dockerfile ${PYTHON_ABI:-""}
734753
;;
735754
capi)
736755
cmake_gen ${PYTHON_ABI:-""}

0 commit comments

Comments
 (0)