|
5 | 5 | # Set BASE_IMAGE according to env variables
|
6 | 6 | if [ ${WITH_GPU} == "ON" ]; then
|
7 | 7 | BASE_IMAGE="nvidia/cuda:8.0-cudnn5-runtime-ubuntu14.04"
|
8 |
| - # additional packages to install when building gpu images |
9 |
| - GPU_DOCKER_PKG="python-pip python-dev" |
10 | 8 | else
|
11 |
| - BASE_IMAGE="python:2.7.13-slim" |
12 |
| - # FIXME: python base image uses different python version than WITH_GPU |
13 |
| - # need to change PYTHONHOME to /usr/local when using python base image |
14 |
| - CPU_DOCKER_PYTHON_HOME_ENV="ENV PYTHONHOME /usr/local" |
| 9 | + BASE_IMAGE="ubuntu:14.04" |
15 | 10 | fi
|
16 | 11 |
|
17 | 12 | DOCKERFILE_GPU_ENV=""
|
@@ -60,10 +55,7 @@ if [ ${WITH_DOC} == "ON" ]; then
|
60 | 55 | popd
|
61 | 56 | fi
|
62 | 57 | # generate deb package for current build
|
63 |
| -# FIXME(typhoonzero): should we remove paddle/scripts/deb ? |
64 |
| -# FIXME: CPACK_DEBIAN_PACKAGE_DEPENDS removes all dev dependencies, must |
65 |
| -# install them in docker |
66 |
| -cpack -D CPACK_GENERATOR='DEB' -D CPACK_DEBIAN_PACKAGE_DEPENDS="" .. |
| 58 | +cpack -D CPACK_GENERATOR='DEB' .. |
67 | 59 |
|
68 | 60 | if [[ ${WOBOQ:-OFF} == 'ON' ]]; then
|
69 | 61 | apt-get install -y clang-3.8 llvm-3.8 libclang-3.8-dev
|
|
91 | 83 |
|
92 | 84 | paddle version
|
93 | 85 |
|
94 |
| -if [[ -n ${APT_MIRROR} ]]; then |
95 |
| - MIRROR_UPDATE="sed -i '${APT_MIRROR}' /etc/apt/sources.list && \\" |
96 |
| -else |
97 |
| - MIRROR_UPDATE="\\" |
98 |
| -fi |
99 |
| - |
100 | 86 | cat > /paddle/build/Dockerfile <<EOF
|
101 | 87 | FROM ${BASE_IMAGE}
|
102 | 88 | MAINTAINER PaddlePaddle Authors <[email protected]>
|
103 | 89 | ENV HOME /root
|
104 | 90 | ENV LANG en_US.UTF-8
|
105 | 91 | # Use Fix locales to en_US.UTF-8
|
106 |
| -RUN ${MIRROR_UPDATE} |
107 |
| - apt-get update && \ |
108 |
| - apt-get install -y libgfortran3 libpython2.7 ${GPU_DOCKER_PKG} && \ |
109 |
| - apt-get clean -y && \ |
110 |
| - pip install --upgrade pip && \ |
111 |
| - pip install -U 'protobuf==3.1.0' requests numpy |
| 92 | +EOF |
| 93 | + |
| 94 | +if [[ -n ${APT_MIRROR} ]]; then |
| 95 | +cat >> /paddle/build/Dockerfile <<EOF |
| 96 | +RUN sed -i '${APT_MIRROR}' /etc/apt/sources.list |
| 97 | +EOF |
| 98 | +fi |
| 99 | + |
| 100 | +cat >> /paddle/build/Dockerfile <<EOF |
112 | 101 | # Use different deb file when building different type of images
|
113 |
| -ADD build/*.deb /usr/local/opt/paddle/deb/ |
| 102 | +ADD build/*.deb / |
114 | 103 | # run paddle version to install python packages first
|
115 |
| -RUN dpkg -i /usr/local/opt/paddle/deb/*.deb && \ |
116 |
| - rm -f /usr/local/opt/paddle/deb/*.deb && \ |
117 |
| - find /usr/ -name '*paddle-*.whl' | xargs pip install && \ |
| 104 | +RUN apt-get update &&\ |
| 105 | + apt-get install -y python-pip && pip install -U pip && \ |
| 106 | + dpkg -i /*.deb ; apt-get install -f -y && \ |
| 107 | + apt-get clean -y && \ |
| 108 | + rm -f /*.deb && \ |
118 | 109 | paddle version
|
119 |
| -${CPU_DOCKER_PYTHON_HOME_ENV} |
120 | 110 | ${DOCKERFILE_CUDNN_DSO}
|
121 | 111 | ${DOCKERFILE_GPU_ENV}
|
122 | 112 | # default command shows the paddle version and exit
|
|
0 commit comments