提交 bd689cbb 编写于 作者: G gangliao 提交者: GitHub

Merge pull request #1578 from gangliao/book

Add Book in Docker
...@@ -42,7 +42,7 @@ Windows -- in a consistent way. ...@@ -42,7 +42,7 @@ Windows -- in a consistent way.
.. code-block:: bash .. 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 This runs a container of the development environment Docker image
with the local source tree mounted to :code:`/paddle` of the with the local source tree mounted to :code:`/paddle` of the
...@@ -82,6 +82,29 @@ Windows -- in a consistent way. ...@@ -82,6 +82,29 @@ Windows -- in a consistent way.
cd /paddle/build cd /paddle/build
ctest 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 CPU-only and GPU Images
----------------------- -----------------------
......
...@@ -50,7 +50,9 @@ RUN curl -sSL https://cmake.org/files/v3.4/cmake-3.4.1.tar.gz | tar -xz && \ ...@@ -50,7 +50,9 @@ RUN curl -sSL https://cmake.org/files/v3.4/cmake-3.4.1.tar.gz | tar -xz && \
cd .. && rm -rf cmake-3.4.1 cd .. && rm -rf cmake-3.4.1
COPY . /paddle/ COPY . /paddle/
RUN cd /paddle/ && git submodule update --init --recursive
RUN /paddle/paddle/scripts/docker/build.sh RUN /paddle/paddle/scripts/docker/build.sh
VOLUME ["/usr/share/nginx/html/data", "/usr/share/nginx/html/paddle"] VOLUME ["/usr/share/nginx/html/data", "/usr/share/nginx/html/paddle"]
# Configure OpenSSH server. c.f. https://docs.docker.com/engine/examples/running_ssh_service # Configure OpenSSH server. c.f. https://docs.docker.com/engine/examples/running_ssh_service
...@@ -60,9 +62,7 @@ RUN sed -ri 's/^PermitRootLogin\s+.*/PermitRootLogin yes/' /etc/ssh/sshd_config ...@@ -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 RUN sed -ri 's/UsePAM yes/#UsePAM yes/g' /etc/ssh/sshd_config
EXPOSE 22 EXPOSE 22
# Jupyter Notebook directory. # Jupyter Notebook: Paddle book
RUN mkdir /notes/
WORKDIR "/notes"
EXPOSE 8888 EXPOSE 8888
COPY ./paddle/scripts/docker/entrypoint /opt/bin/ COPY ./paddle/scripts/docker/entrypoint /opt/bin/
......
...@@ -50,7 +50,9 @@ RUN curl -sSL https://cmake.org/files/v3.4/cmake-3.4.1.tar.gz | tar -xz && \ ...@@ -50,7 +50,9 @@ RUN curl -sSL https://cmake.org/files/v3.4/cmake-3.4.1.tar.gz | tar -xz && \
cd .. && rm -rf cmake-3.4.1 cd .. && rm -rf cmake-3.4.1
COPY . /paddle/ COPY . /paddle/
RUN cd /paddle/ && git submodule update --init --recursive
RUN /paddle/paddle/scripts/docker/build.sh RUN /paddle/paddle/scripts/docker/build.sh
VOLUME ["/usr/share/nginx/html/data", "/usr/share/nginx/html/paddle"] VOLUME ["/usr/share/nginx/html/data", "/usr/share/nginx/html/paddle"]
# Configure OpenSSH server. c.f. https://docs.docker.com/engine/examples/running_ssh_service # Configure OpenSSH server. c.f. https://docs.docker.com/engine/examples/running_ssh_service
...@@ -60,9 +62,7 @@ RUN sed -ri 's/^PermitRootLogin\s+.*/PermitRootLogin yes/' /etc/ssh/sshd_config ...@@ -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 RUN sed -ri 's/UsePAM yes/#UsePAM yes/g' /etc/ssh/sshd_config
EXPOSE 22 EXPOSE 22
# Jupyter Notebook directory. # Jupyter Notebook: Paddle book
RUN mkdir /notes/
WORKDIR "/notes"
EXPOSE 8888 EXPOSE 8888
COPY ./paddle/scripts/docker/entrypoint /opt/bin/ COPY ./paddle/scripts/docker/entrypoint /opt/bin/
......
...@@ -17,7 +17,8 @@ if [[ ${BUILD_AND_INSTALL:-OFF} == 'ON' ]]; then ...@@ -17,7 +17,8 @@ if [[ ${BUILD_AND_INSTALL:-OFF} == 'ON' ]]; then
fi fi
mkdir -p /paddle/build # -p means no error if exists 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 .. \ cmake .. \
-DWITH_DOC=${WITH_DOC:-OFF} \ -DWITH_DOC=${WITH_DOC:-OFF} \
-DWITH_GPU=${WITH_GPU:-OFF} \ -DWITH_GPU=${WITH_GPU:-OFF} \
......
#!/bin/bash #!/bin/bash
LOG=/var/log/all
touch $LOG /usr/sbin/sshd -D &
jupyter notebook --ip=0.0.0.0 /paddle/book/
/usr/sbin/sshd -D >> $LOG &
jupyter notebook --ip=0.0.0.0 /notes/ >> $LOG &
tail -f $LOG
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册