Skip to content

Commit da5b375

Browse files
committed
Merge branch 'feature/jupyter_docker' of github.com:reyoung/Paddle into feature/jupyter_docker
2 parents 6d62819 + febdc08 commit da5b375

File tree

2 files changed

+32
-4
lines changed

2 files changed

+32
-4
lines changed

paddle/scripts/docker/Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@ WORKDIR "/notes"
5050
EXPOSE 8888
5151

5252
RUN mkdir -p /opt/run
53-
ADD 00_sshd /opt/run/
54-
ADD 01_jupyter /opt/run/
55-
ADD run_all /opt/run/
53+
COPY ./paddle/scripts/docker/jupyter_notebook_config.py /root/.jupyter/
54+
COPY ./paddle/scripts/docker/00_sshd /opt/run/
55+
COPY ./paddle/scripts/docker/01_jupyter /opt/run/
56+
COPY ./paddle/scripts/docker/run_all /opt/bin/
5657

57-
ENTRYPOINT ["/opt/bin/run_all"]
58+
CMD ["/opt/bin/run_all"]
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# from https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/docker/jupyter_notebook_config.py
2+
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
# ==============================================================================
16+
import os
17+
from IPython.lib import passwd
18+
19+
c.NotebookApp.ip = '*'
20+
c.NotebookApp.port = int(os.getenv('PORT', 8888))
21+
c.NotebookApp.open_browser = False
22+
c.MultiKernelManager.default_kernel_name = 'python2'
23+
24+
# sets a password if PASSWORD is set in the environment
25+
if 'PASSWORD' in os.environ:
26+
c.NotebookApp.password = passwd(os.environ['PASSWORD'])
27+
del os.environ['PASSWORD']

0 commit comments

Comments
 (0)