Skip to content

Commit 37f7595

Browse files
authored
Merge pull request #927 from wen-bo-yang/develop_test
support UBUNTU MIRROR and modify doc
2 parents 42e1217 + bf26679 commit 37f7595

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

doc/getstarted/build_and_install/docker_install_en.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,20 @@ The general development workflow with Docker and Bazel is as follows:
3939
code. This image contains all the development tools and
4040
dependencies of PaddlePaddle.
4141

42-
4342
.. code-block:: bash
4443
4544
cd paddle
4645
docker build -t paddle:dev -f paddle/scripts/docker/Dockerfile .
4746
47+
Sometimes docker build might suffer from a slow network connection to the official Ubuntu apt-source servers. In such case, we can specify an apt-source mirror server that is geologically nearer to us. In the following example, we specified an apt-source server that responds fast in China.You can specify the UBUNTU MIRROR with :code:`--build-arg UBUNTU_MIRROR` like the example below.
48+
49+
.. code-block:: bash
50+
51+
docker build \
52+
--build-arg UBUNTU_MIRROR="http://mirrors.163.com" \
53+
-t paddle:dev \
54+
-f paddle/scripts/docker/Dockerfile .
55+
4856
4957
3. Run the image as a container and mounting local source code
5058
directory into the container. This allows us to change the code on

paddle/scripts/docker/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ FROM ubuntu:14.04
22
MAINTAINER PaddlePaddle Authors <[email protected]>
33

44
ARG DEBIAN_FRONTEND=noninteractive
5+
ARG UBUNTU_MIRROR
6+
RUN /bin/bash -c 'if [[ -n ${UBUNTU_MIRROR} ]]; then sed -i 's#http://archive.ubuntu.com#${UBUNTU_MIRROR}#g' /etc/apt/sources.list; fi'
57
RUN apt-get update \
68
&& apt-get install -y cmake libprotobuf-dev protobuf-compiler git \
79
libgoogle-glog-dev libgflags-dev libgtest-dev \

paddle/scripts/docker/Dockerfile.gpu

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ FROM nvidia/cuda:7.5-cudnn5-devel-ubuntu14.04
22
MAINTAINER PaddlePaddle Authors <[email protected]>
33

44
ARG DEBIAN_FRONTEND=noninteractive
5+
ARG UBUNTU_MIRROR
6+
RUN /bin/bash -c 'if [[ -n ${UBUNTU_MIRROR} ]]; then sed -i 's#http://archive.ubuntu.com#${UBUNTU_MIRROR}#g' /etc/apt/sources.list; fi'
57
RUN apt-get update \
68
&& apt-get install -y cmake libprotobuf-dev protobuf-compiler git \
79
libgoogle-glog-dev libgflags-dev libgtest-dev \

0 commit comments

Comments
 (0)