25
25
BASE_IMAGE=" python:2.7.13-slim"
26
26
if [ ${WITH_AVX} == " ON" ]; then
27
27
DEB_PATH=" dist/cpu/"
28
- DOCKER_SUFFIX=" "
28
+ DOCKER_SUFFIX=" cpu "
29
29
else
30
30
DEB_PATH=" dist/cpu-noavx/"
31
31
DOCKER_SUFFIX=" noavx"
@@ -40,8 +40,11 @@ if [[ ${BUILD_AND_INSTALL:-OFF} == 'ON' ]]; then
40
40
fi
41
41
42
42
mkdir -p /paddle/build # -p means no error if exists
43
+ cd /paddle/build
43
44
# clean local cmake and third_party cache
44
- cd /paddle/build && rm -rf * && rm -rf ../third_party
45
+ if [ ${DELETE_BUILD_CACHE} == ' ON' ]; then
46
+ rm -rf * && rm -rf ../third_party
47
+ fi
45
48
cmake .. \
46
49
-DWITH_DOC=${WITH_DOC:- OFF} \
47
50
-DWITH_GPU=${WITH_GPU:- OFF} \
@@ -54,7 +57,9 @@ if [[ ${BUILD_AND_INSTALL:-OFF} == 'ON' ]]; then
54
57
make install
55
58
# generate deb package for current build
56
59
# FIXME(typhoonzero): should we remove paddle/scripts/deb ?
57
- cpack -D CPACK_GENERATOR=' DEB' ..
60
+ # FIXME: CPACK_DEBIAN_PACKAGE_DEPENDS removes all dev dependencies, must
61
+ # install them in docker
62
+ cpack -D CPACK_GENERATOR=' DEB' -D CPACK_DEBIAN_PACKAGE_DEPENDS=" " ..
58
63
mv /paddle/build/* .deb /paddle/${DEB_PATH}
59
64
60
65
if [[ ${BUILD_WOBOQ:- OFF} == ' ON' ]]; then
@@ -123,7 +128,7 @@ RUN ${MIRROR_UPDATE}
123
128
apt-get install -y libgfortran3 && \
124
129
apt-get clean -y && \
125
130
pip install --upgrade pip && \
126
- pip install -U 'protobuf==3.1.0'
131
+ pip install -U 'protobuf==3.1.0' requests
127
132
RUN pip install numpy
128
133
# Use different deb file when building different type of images
129
134
ADD \$ PWD/${DEB_PATH} *.deb /usr/local/opt/paddle/deb/
0 commit comments