Skip to content

Commit

Permalink
Merge pull request PaddlePaddle#1596 from helinwang/slim
Browse files Browse the repository at this point in the history
reduce docker image size by removing /build in or docker build
  • Loading branch information
helinwang authored Mar 9, 2017
2 parents 76749f6 + 00f88d4 commit 299e959
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions paddle/scripts/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ ENV WITH_GPU=OFF
ENV WITH_AVX=${WITH_AVX:-ON}
ENV WITH_DOC=${WITH_DOC:-OFF}
ENV WITH_STYLE_CHECK=${WITH_STYLE_CHECK:-OFF}
ENV DOCKER_BUILD=TRUE

ENV HOME /root

Expand Down
1 change: 1 addition & 0 deletions paddle/scripts/docker/Dockerfile.gpu
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ ENV WITH_GPU=ON
ENV WITH_AVX=${WITH_AVX:-ON}
ENV WITH_DOC=${WITH_DOC:-OFF}
ENV WITH_STYLE_CHECK=${WITH_STYLE_CHECK:-OFF}
ENV DOCKER_BUILD=TRUE

ENV HOME /root

Expand Down
6 changes: 6 additions & 0 deletions paddle/scripts/docker/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ if [[ ${BUILD_AND_INSTALL:-OFF} == 'ON' ]]; then
pip install /usr/local/opt/paddle/share/wheels/py_paddle*linux*.whl
pip install /usr/local/opt/paddle/share/wheels/paddle*.whl
paddle version

if [[ ${DOCKER_BUILD:-FALSE} == 'TRUE' ]]; then
# reduce docker image size
rm -rf /paddle/build
rm -rf /usr/local/opt/paddle/share/wheels/
fi
fi

trap : 0

0 comments on commit 299e959

Please sign in to comment.