提交 f66fd44f 编写于 作者: Y yi.wu

do not use docker cp

上级 a6eec022
*.DS_Store
build/
build/paddle/math
build/paddle/utils
build/paddle/gserver
*.user
.vscode
......
#!/bin/bash
BINARIES_DIR=paddle/scripts/docker/buildimage/binaries
BUILD_DIR=$PWD/build
function build_in_docker() {
docker build . -t paddle-build-env -f paddle/scripts/docker/buildimage/Dockerfile.build
BUILDER=$(docker run -d paddle-build-env)
if [ ! -d $BUILD_DIR ]; then
mkdir -p $BUILD_DIR
fi
docker build . -t paddle-build-env -f paddle/scripts/docker/paddle-dev/Dockerfile
# FIXME: need to wait a signal not sleeping
BUILDER=$(docker run -d -v ${PWD}:/paddle paddle-build-env sleep 3600)
# TODO(typhoonzero):
docker exec $BUILDER /bin/bash -c "export BUILD_AND_INSTALL=ON && /paddle/paddle/scripts/docker/build.sh"
mkdir -p $BINARIES_DIR
docker cp $BUILDER:/usr/local/opt/paddle/bin/paddle_pserver_main $BINARIES_DIR
docker cp $BUILDER:/usr/local/opt/paddle/bin/paddle_trainer $BINARIES_DIR
docker cp $BUILDER:/usr/local/opt/paddle/bin/paddle_merge_model $BINARIES_DIR
docker cp $BUILDER:/usr/local/bin/paddle $BINARIES_DIR
docker cp $BUILDER:/usr/local/opt/paddle/bin/paddle_usage $BINARIES_DIR
docker cp $BUILDER:/usr/local/opt/paddle/share/wheels $BINARIES_DIR
# docker cp $BUILDER:/usr/local/opt/paddle/bin/paddle_pserver_main $BINARIES_DIR
# docker cp $BUILDER:/usr/local/opt/paddle/bin/paddle_trainer $BINARIES_DIR
# docker cp $BUILDER:/usr/local/opt/paddle/bin/paddle_merge_model $BINARIES_DIR
# docker cp $BUILDER:/usr/local/bin/paddle $BINARIES_DIR
# docker cp $BUILDER:/usr/local/opt/paddle/bin/paddle_usage $BINARIES_DIR
#
# docker cp $BUILDER:/usr/local/opt/paddle/share/wheels $BINARIES_DIR
docker stop $BUILDER && docker rm $BUILDER
}
function build_paddle_core() {
docker build . -t paddle-core -f paddle/scripts/docker/paddle-core/Dockerfile
}
build_in_docker
build_paddle_core
#build_paddle_core
......@@ -24,10 +24,14 @@ RUN sed 's@http:\/\/archive.ubuntu.com\/ubuntu\/@mirror:\/\/mirrors.ubuntu.com\/
pip install -U 'protobuf==3.1.0'
RUN pip install numpy
ADD paddle/scripts/docker/buildimage/binaries/paddle paddle/scripts/docker/buildimage/binaries/paddle_trainer \
paddle/scripts/docker/buildimage/binaries/paddle_pserver_main paddle/scripts/docker/buildimage/binaries/paddle_merge_model \
paddle/scripts/docker/buildimage/binaries/paddle_usage /usr/local/opt/paddle/bin/
ADD paddle/scripts/docker/buildimage/binaries/wheels/py_paddle*linux*.whl paddle/scripts/docker/buildimage/binaries/wheels/paddle*.whl \
ADD build/paddle/trainer/paddle_trainer \
build/paddle/pserver/paddle_pserver_main \
build/paddle/trainer/paddle_merge_model \
/usr/local/opt/paddle/bin/
ADD build/paddle/scripts/usage.sh /usr/local/opt/paddle/bin/paddle_usage
ADD paddle/scripts/submit_local.sh.in /usr/bin/paddle
ADD paddle/dist/py_paddle*linux*.whl build/python/dist/paddle*.whl \
/usr/local/opt/paddle/share/wheels/
RUN pip install /usr/local/opt/paddle/share/wheels/py_paddle*linux*.whl && \
pip install /usr/local/opt/paddle/share/wheels/paddle*.whl && \
......
......@@ -48,12 +48,5 @@ RUN curl -sSL https://cmake.org/files/v3.4/cmake-3.4.1.tar.gz | tar -xz && \
cd cmake-3.4.1 && ./bootstrap && make -j `nproc` && make install && \
cd .. && rm -rf cmake-3.4.1
COPY . /paddle/
RUN cd /paddle/ && git submodule update --init --recursive
RUN /paddle/paddle/scripts/docker/build.sh
VOLUME ["/usr/share/nginx/html/data", "/usr/share/nginx/html/paddle"]
# FIXME: wait a long time is OK
CMD ["sleep", "3600"]
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册