Skip to content

Commit 37ee365

Browse files
committed
Change production mode Dockerfile to support python3
test=develop
1 parent 1f4a434 commit 37ee365

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
@@ -609,7 +609,24 @@ EOF
609609
CMD='"true"'
610610
fi
611611

612-
cat >> ${PADDLE_ROOT}/build/Dockerfile <<EOF
612+
if [ "$1" == "cp35-cp35m" ]; then
613+
cat >> ${PADDLE_ROOT}/build/Dockerfile <<EOF
614+
ADD python/dist/*.whl /
615+
# run paddle version to install python packages first
616+
RUN apt-get update && ${NCCL_DEPS}
617+
RUN apt-get install -y wget python3 python3-pip libgtk2.0-dev dmidecode python3-tk && \
618+
pip3 install opencv-python && pip3 install /*.whl; apt-get install -f -y && \
619+
apt-get clean -y && \
620+
rm -f /*.whl && \
621+
${PADDLE_VERSION} && \
622+
ldconfig
623+
${DOCKERFILE_CUDNN_DSO}
624+
${DOCKERFILE_CUBLAS_DSO}
625+
${DOCKERFILE_GPU_ENV}
626+
ENV NCCL_LAUNCH_MODE PARALLEL
627+
EOF
628+
else
629+
cat >> ${PADDLE_ROOT}/build/Dockerfile <<EOF
613630
ADD python/dist/*.whl /
614631
# run paddle version to install python packages first
615632
RUN apt-get update && ${NCCL_DEPS}
@@ -624,6 +641,8 @@ EOF
624641
${DOCKERFILE_GPU_ENV}
625642
ENV NCCL_LAUNCH_MODE PARALLEL
626643
EOF
644+
fi
645+
627646
if [[ ${WITH_GOLANG:-OFF} == "ON" ]]; then
628647
cat >> ${PADDLE_ROOT}/build/Dockerfile <<EOF
629648
ADD go/cmd/pserver/pserver /usr/bin/
@@ -698,7 +717,7 @@ function main() {
698717
build)
699718
cmake_gen ${PYTHON_ABI:-""}
700719
build
701-
gen_dockerfile
720+
gen_dockerfile ${PYTHON_ABI:-""}
702721
;;
703722
build_android)
704723
build_android
@@ -725,7 +744,7 @@ function main() {
725744
gen_html
726745
;;
727746
dockerfile)
728-
gen_dockerfile
747+
gen_dockerfile ${PYTHON_ABI:-""}
729748
;;
730749
capi)
731750
cmake_gen ${PYTHON_ABI:-""}

0 commit comments

Comments
 (0)