diff --git a/doc/getstarted/build_and_install/docker_install_en.rst b/doc/getstarted/build_and_install/docker_install_en.rst index 5a1056e859a0c977c9cd365ff1e4ffe58596f41f..a92201c618ca747168ac755a150e0eb93733c519 100644 --- a/doc/getstarted/build_and_install/docker_install_en.rst +++ b/doc/getstarted/build_and_install/docker_install_en.rst @@ -42,7 +42,7 @@ Windows -- in a consistent way. .. code-block:: bash - docker run -d -p 2202:22 -v $PWD:/paddle paddle:dev + docker run -d -p 2202:22 -p 8888:8888 -v $PWD:/paddle paddle:dev This runs a container of the development environment Docker image with the local source tree mounted to :code:`/paddle` of the @@ -82,6 +82,29 @@ Windows -- in a consistent way. cd /paddle/build ctest +4. Run PaddlePaddle Book under Docker Container + + The Jupyter Notebook is an open-source web application that allows + you to create and share documents that contain live code, equations, + visualizations and explanatory text in a single browser. + + PaddlePaddle Book is an interactive Jupyter Notebook for users and developers. + We already exposed port 8888 for this book. If you want to + dig deeper into deep learning, PaddlePaddle Book definitely is your best choice. + + Once you are inside the container, simply issue the command: + + .. code-block:: bash + + jupyter notebook + + Then, you would back and paste the address into the local browser: + + .. code-block:: text + + http://localhost:8888/ + + That's all. Enjoy your journey! CPU-only and GPU Images ----------------------- diff --git a/paddle/scripts/docker/Dockerfile b/paddle/scripts/docker/Dockerfile index 98eaa15a0fdf206c0a0f23a98ee718d70b34ff4b..fa4aee4f8a92299f3f107ffff9ab6336b6012c0f 100644 --- a/paddle/scripts/docker/Dockerfile +++ b/paddle/scripts/docker/Dockerfile @@ -34,6 +34,8 @@ RUN apt-get update && \ # git credential to skip password typing RUN git config --global credential.helper store +# fetch PaddlePaddle book +RUN git submodule update --init --recursive # Fix locales to en_US.UTF-8 RUN localedef -i en_US -f UTF-8 en_US.UTF-8 @@ -60,9 +62,7 @@ RUN sed -ri 's/^PermitRootLogin\s+.*/PermitRootLogin yes/' /etc/ssh/sshd_config RUN sed -ri 's/UsePAM yes/#UsePAM yes/g' /etc/ssh/sshd_config EXPOSE 22 -# Jupyter Notebook directory. -RUN mkdir /notes/ -WORKDIR "/notes" +# Jupyter Notebook: Paddle book EXPOSE 8888 COPY ./paddle/scripts/docker/entrypoint /opt/bin/ diff --git a/paddle/scripts/docker/Dockerfile.gpu b/paddle/scripts/docker/Dockerfile.gpu index 4d30ccdd2b5de27c4dfd110537e69c269028ef31..07b32dda754ae160261b47f9e38d5386fa94f090 100644 --- a/paddle/scripts/docker/Dockerfile.gpu +++ b/paddle/scripts/docker/Dockerfile.gpu @@ -34,6 +34,8 @@ RUN apt-get update && \ # git credential to skip password typing RUN git config --global credential.helper store +# fetch PaddlePaddle book +RUN git submodule update --init --recursive # Fix locales to en_US.UTF-8 RUN localedef -i en_US -f UTF-8 en_US.UTF-8 @@ -60,9 +62,7 @@ RUN sed -ri 's/^PermitRootLogin\s+.*/PermitRootLogin yes/' /etc/ssh/sshd_config RUN sed -ri 's/UsePAM yes/#UsePAM yes/g' /etc/ssh/sshd_config EXPOSE 22 -# Jupyter Notebook directory. -RUN mkdir /notes/ -WORKDIR "/notes" +# Jupyter Notebook: Paddle book EXPOSE 8888 COPY ./paddle/scripts/docker/entrypoint /opt/bin/ diff --git a/paddle/scripts/docker/build.sh b/paddle/scripts/docker/build.sh index d9c44f42340323afb4930dab35114f2adc5fbb3a..b2e6416c3d559135eb4aae19bbc517820a510970 100755 --- a/paddle/scripts/docker/build.sh +++ b/paddle/scripts/docker/build.sh @@ -17,7 +17,8 @@ if [[ ${BUILD_AND_INSTALL:-OFF} == 'ON' ]]; then fi mkdir -p /paddle/build # -p means no error if exists - cd /paddle/build + # clean local cmake and third_party cache + cd /paddle/build && rm -rf * && rm -rf ../third_party cmake .. \ -DWITH_DOC=${WITH_DOC:-OFF} \ -DWITH_GPU=${WITH_GPU:-OFF} \ diff --git a/paddle/scripts/docker/entrypoint b/paddle/scripts/docker/entrypoint index 87083467f50acd689ce57b86951f5f7a03c6a58b..cd119917f91ac2e837ccecd92d41eca60772caba 100755 --- a/paddle/scripts/docker/entrypoint +++ b/paddle/scripts/docker/entrypoint @@ -4,5 +4,5 @@ LOG=/var/log/all touch $LOG /usr/sbin/sshd -D >> $LOG & -jupyter notebook --ip=0.0.0.0 /notes/ >> $LOG & +jupyter notebook --ip=0.0.0.0 /paddle/book/ >> $LOG & tail -f $LOG