Cannot save notebook in docker image - docker

I am running a docker image from https://github.com/jupyter/docker-stacks on a machine where I do not have sudo rights.
For some reason, if I run the image like this:
$ docker run -it --rm -p 8888:8888 -v /home/user_name/:/home/jovyan/work/ -e jupyter/datascience-notebook start.sh jupyter lab
What I get back is a 403 Forbidden as I try to save a notebook (or anything) in the jupyter lab. I don't know what this is the case but my next approach would have been to run the image with my user set explicitly:
$ docker run --user=user_name -it --rm -p 8888:8888 -v /home/user_name/:/home/jovyan/work/ -e jupyter/datascience-notebook start.sh jupyter lab
but this will give me:
Unable to find image 'start.sh:latest' locally
docker: Error response from daemon: repository start.sh not found: does not exist or no pull access.
See 'docker run --help'
I'm not sure what the problem would be here.
Here's the log output I'm getting:
$ docker run -it --rm -p 8888:8888 -v /home/sfalk/:/home/jovyan/work/ jupyter/datascience-notebook start.sh jupyter lab
Executing the command: jupyter lab
[I 16:32:30.518 LabApp] Writing notebook server cookie secret to /home/jovyan/.local/share/jupyter/runtime/notebook_cookie_secret
[W 16:32:30.991 LabApp] WARNING: The notebook server is listening on all IP addresses and not using encryption. This is not recommended.
[I 16:32:31.003 LabApp] JupyterLab beta preview extension loaded from /opt/conda/lib/python3.6/site-packages/jupyterlab
[I 16:32:31.003 LabApp] JupyterLab application directory is /opt/conda/share/jupyter/lab
[I 16:32:31.015 LabApp] Serving notebooks from local directory: /home/jovyan
[I 16:32:31.015 LabApp] 0 active kernels
[I 16:32:31.015 LabApp] The Jupyter Notebook is running at:
[I 16:32:31.015 LabApp] http://[all ip addresses on your system]:8888/?token=d8fcfc531371f23a265cdc0ffa8db41a784473137827f0da
[I 16:32:31.015 LabApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 16:32:31.016 LabApp]
Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
http://localhost:8888/?token=d8fcfc531371f23a265cdc0ffa8db41a784473137827f0da
[W 16:32:31.801 LabApp] Forbidden
[W 16:32:31.802 LabApp] 403 GET /api/sessions?1518798751791 (192.168.108.41) 3.76ms referer=http://192.168.111.242:8888/lab
[W 16:32:31.805 LabApp] Forbidden
[W 16:32:31.806 LabApp] 403 GET /api/terminals?1518798751792 (192.168.108.41) 2.13ms referer=http://192.168.111.242:8888/lab
[I 16:32:39.936 LabApp] 302 GET /?token=d8fcfc531371f23a265cdc0ffa8db41a784473137827f0da (192.168.108.41) 1.19ms
[I 16:32:40.457 LabApp] Build is up to date
[I 16:32:40.687 LabApp] Writing notebook-signing key to /home/jovyan/.local/share/jupyter/notebook_secret
[W 16:32:40.692 LabApp] Notebook work/workspaces/manz-search/python/notebook/001-bundesrechtsindex.ipynb is not trusted
[W 16:32:41.332 LabApp] 403 GET /api/contents/work/workspaces/manz-search/python/notebook/001-bundesrechtsindex.ipynb/checkpoints?1518798761326 (192.168.108.41): Permission denied: work/workspaces/manz-search/python/notebook/.ipynb_checkpoints
[W 16:32:41.332 LabApp] Permission denied: work/workspaces/manz-search/python/notebook/.ipynb_checkpoints
[W 16:32:41.333 LabApp] 403 GET /api/contents/work/workspaces/manz-search/python/notebook/001-bundesrechtsindex.ipynb/checkpoints?1518798761326 (192.168.108.41) 2.84ms referer=http://192.168.111.242:8888/lab
[I 16:32:41.386 LabApp] Kernel started: cc8c97eb-beeb-40b0-b4a6-bb9e59645496
[W 16:32:41.627 LabApp] 403 GET /api/contents/work/workspaces/manz-search/python/notebook/001-bundesrechtsindex.ipynb/checkpoints?1518798761624 (192.168.108.41): Permission denied: work/workspaces/manz-search/python/notebook/.ipynb_checkpoints
[W 16:32:41.628 LabApp] Permission denied: work/workspaces/manz-search/python/notebook/.ipynb_checkpoints
[W 16:32:41.628 LabApp] 403 GET /api/contents/work/workspaces/manz-search/python/notebook/001-bundesrechtsindex.ipynb/checkpoints?1518798761624 (192.168.108.41) 1.58ms referer=http://192.168.111.242:8888/lab
[I 16:32:42.244 LabApp] Adapting to protocol v5.1 for kernel cc8c97eb-beeb-40b0-b4a6-bb9e59645496
[I 16:32:42.260 LabApp] Adapting to protocol v5.1 for kernel cc8c97eb-beeb-40b0-b4a6-bb9e59645496
[I 16:32:44.944 LabApp] Saving file at /work/workspaces/manz-search/python/notebook/001-bundesrechtsindex.ipynb
[W 16:32:44.946 LabApp] Notebook work/workspaces/manz-search/python/notebook/001-bundesrechtsindex.ipynb is not trusted
[W 16:32:44.947 LabApp] 403 PUT /api/contents/work/workspaces/manz-search/python/notebook/001-bundesrechtsindex.ipynb?1518798764934 (192.168.108.41): Permission denied: work/workspaces/manz-search/python/notebook/001-bundesrechtsindex.ipynb
[W 16:32:44.948 LabApp] Permission denied: work/workspaces/manz-search/python/notebook/001-bundesrechtsindex.ipynb
[W 16:32:44.948 LabApp] 403 PUT /api/contents/work/workspaces/manz-search/python/notebook/001-bundesrechtsindex.ipynb?1518798764934 (192.168.108.41) 9.11ms referer=http://192.168.111.242:8888/lab
[W 16:32:44.957 LabApp] 403 POST /api/contents/work/workspaces/manz-search/python/notebook/001-bundesrechtsindex.ipynb/checkpoints?1518798764953 (192.168.108.41): Permission denied: work/workspaces/manz-search/python/notebook/.ipynb_checkpoints
[W 16:32:44.958 LabApp] Permission denied: work/workspaces/manz-search/python/notebook/.ipynb_checkpoints
[W 16:32:44.959 LabApp] 403 POST /api/contents/work/workspaces/manz-search/python/notebook/001-bundesrechtsindex.ipynb/checkpoints?1518798764953 (192.168.108.41) 2.94ms referer=http://192.168.111.242:8888/lab

docker run -it --rm -p 8888:8888 -v $HOME/test:/home/jovyan/work/ -e NB_UID=$(id -u) -e NB_GID=$(id -g) -e GRANT_SUDO=yes jupyter/datascience-notebook
I should note, if you're on OSX, you won't need this, my original response is enough.
Both
docker run -it --rm -p 8888:8888 -v $HOME:/home/jovyan/work/jupyter/datascience-notebook jupyter lab
and
docker run -it --rm -p 8888:8888 -v $HOME:/home/jovyan/work/ jupyter/datascience-notebook
work like a charm, no sudo, no fuss

Related

Inconsistent trust status of Jupyter-Notbooks in Docker

I have a docker image containing two .ipynb notebooks to run when starting a container from this image.
Here are the steps from within the DockerFile to copy and trust the notebooks:
USER root
RUN mkdir -p $NOTEBOOK_DIR
COPY /PATH/TO/NOTEBOOK/NB1.ipynb $NOTEBOOK_DIR
COPY /PATH/TO/NOTEBOOK/NB2.ipynb $NOTEBOOK_DIR
RUN chown -R $NB_USER:$NB_GID $NOTEBOOK_DIR
USER $NB_UID
WORKDIR $HOME
RUN jupyter trust $NOTEBOOK_DIR/NB1.ipynb
RUN jupyter trust $NOTEBOOK_DIR/NB2.ipynb
The ENTRYPOINT ["start-notebooks.sh"] runs the following script:
#!/bin/bash
set -e
NB_PASS=$(echo ${SOME_ID} | python3.8 -c 'from notebook.auth import passwd;print(passwd(input()))')
# Run notebooks
jupyter trust $NOTEBOOK_DIR/NB1.ipynb
jupyter trust $NOTEBOOK_DIR/NB2.ipynb
jupyter-notebook --no-browser --ip 0.0.0.0 --port 8888 --NotebookApp.allow_origin='*' \
--NotebookApp.allow_remote_access=True --NotebookApp.quit_button=False --NotebookApp.terminals_enabled=False \
--NotebookApp.trust_xheaders=True --NotebookApp.open_browser=False --NotebookApp.notebook_dir=$NOTEBOOK_DIR \
--NotebookApp.password=${NB_PASS}
When I run and start the container I get the following output:
my_user#my_host:~$ docker run -it --rm -p 8888:8888 --expose 8888 -v /efs/PATH/TO/NOTEBOOK_FILES:/efs/PATH/TO/NOTEBOOK_FILES -e BASE_PATH=/efs/PATH/TO/BASE_PATH -e SOME_ID=fd283b38-3e4a-11eb-a205-7085c2c5e519 notebooks-image:latest
**Notebook already signed: /home/nb_user/notebooks/NB1.ipynb**
/home/nb_user/.local/lib/python3.8/site-packages/nbformat/__init__.py:92: MissingIDFieldWarning: Code cell is missing an id field, this will become a hard error in future nbformat versions. You may want to use `normalize()` on your notebooks before validations (available since nbformat 5.1.4). Previous versions of nbformat are fixing this issue transparently, and will stop doing so in the future.
validate(nb)
**Signing notebook: /home/nb_user/notebooks/NB2.ipynb**
[I 11:40:10.051 NotebookApp] Writing notebook server cookie secret to /home/nb_user/.local/share/jupyter/runtime/notebook_cookie_secret
[I 11:40:10.303 NotebookApp] [jupyter_nbextensions_configurator] enabled 0.6.1
[I 2022-12-11 11:40:10.507 LabApp] JupyterLab extension loaded from /home/nb_user/.local/lib/python3.8/site-packages/jupyterlab
[I 2022-12-11 11:40:10.507 LabApp] JupyterLab application directory is /home/nb_user/.local/share/jupyter/lab
[I 11:40:10.513 NotebookApp] Serving notebooks from local directory: /home/nb_user/notebooks
[I 11:40:10.513 NotebookApp] Jupyter Notebook 6.5.2 is running at:
[I 11:40:10.513 NotebookApp] http://my_host:8888/
[I 11:40:10.513 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[I 11:59:33.290 NotebookApp] 302 GET / (192.168.x.x) 1.300000ms
[W 11:59:33.303 NotebookApp] Clearing invalid/expired login cookie username-my_host-8888
[I 11:59:33.304 NotebookApp] 302 GET /tree? (192.168.x.x) 2.570000ms
[W 11:59:43.120 NotebookApp] Not allowing login redirect to '/tree?'
[I 11:59:43.120 NotebookApp] 302 POST /login?next=%2Ftree%3F (192.168.x.x) 63.300000ms
[I 11:59:43.191 NotebookApp] 302 GET / (192.168.x.x) 1.130000ms
/home/nb_user/.local/lib/python3.8/site-packages/nbformat/__init__.py:92: MissingIDFieldWarning: Code cell is missing an id field, this will become a hard error in future nbformat versions. You may want to use `normalize()` on your notebooks before validations (available since nbformat 5.1.4). Previous versions of nbformat are fixing this issue transparently, and will stop doing so in the future.
validate(nb)
[W 11:59:47.222 NotebookApp] **Notebook NB2.ipynb is not trusted**
When I open NB1 in Jupyter Notebook GUI it is already trusted and I can start working immediately.
But when I open NB2 within the Jupyter Notebook GUI, it automatically pops up:
I'm aware of this answer for the question Jupyter notebook not trusted. It states:
This can also happen when you create a notebook in a docker container with mounted volume (the file is owned by the root user) and then open in in jupyter running on the host machine. Changing file owner to the host user helps.
My Questions are:
Assuming NB1.ipynb and NB2.ipynb both have the same ownership and permissions, are the rest of my steps OK?
If so, why is NB1 trusted and NB2 is not?
I was able to fix this issue after investigating this error from my contianer output above:
MissingIDFieldWarning: Code cell is missing an id field
I found this question, which is the opposite of my error message above.
I compared the nbformat_minor value in both NB1 and NB2 notebook metadata.
In NB1 is was "nbformat_minor": 4 whereas in NB2 it was "nbformat_minor": 5.
as suggested in the answer, I changed within my notebook the nbformat_minor from 5 to 4.
In short I opened my notebook in a text editor and changed in the end of the notebook to:
{
"nbformat": 4,
"nbformat_minor": 4
}
This fixed my issue with both notebooks trusted when running the container.

How to get a Jupyter Notebook to run with docker run when it already works with docker compose?

I am unable to open Jupyter Notebooks in the web browser when I use a Docker image using the docker run command. I get the following error:
This site can’t be reached. The webpage at http://127.0.0.1:8888/?token=8543b16468608a7d26b8183256a97ebc3df41bf8838a3729 might be temporarily down or it may have moved permanently to a new web address. ERR_SOCKET_NOT_CONNECTED
So far, I noticed it doesn't work for me from Jupyter and Tensorflow docker images. However, if I use the same image tags in a Dockerfile and use the docker-compose command everything works fine.
I also tried building the image and then running the image but that didn't work either.
I build from the Dockerfile:
docker build -t notebook .
and then do
docker run --rm -p 8888:8888 -v $(pwd):/home/jovyan/work notebook
It seems that only using docker-compose works for me when trying to use Jupyter Notebook. Anybody know why that is?
OS: Ubuntu 20.04 LTS
Computer model HP ZBook
Docker run command and output (doesn't work)
docker run --rm -p 8888:8888 -v $(pwd):/home/jovyan/work jupyter/minimal-notebook:notebook-6.4.3
The output from the terminal
WARN: Jupyter Notebook deprecation notice https://github.com/jupyter/docker-stacks#jupyter-notebook-deprecation-notice.
Executing the command: jupyter notebook
[I 14:17:21.359 NotebookApp] Writing notebook server cookie secret to /home/jovyan/.local/share/jupyter/runtime/notebook_cookie_secret
[W 2021-08-31 14:17:21.823 LabApp] 'ip' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2021-08-31 14:17:21.823 LabApp] 'port' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2021-08-31 14:17:21.823 LabApp] 'port' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2021-08-31 14:17:21.823 LabApp] 'port' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[I 2021-08-31 14:17:21.830 LabApp] JupyterLab extension loaded from /opt/conda/lib/python3.9/site-packages/jupyterlab
[I 2021-08-31 14:17:21.831 LabApp] JupyterLab application directory is /opt/conda/share/jupyter/lab
[I 14:17:21.835 NotebookApp] Serving notebooks from local directory: /home/jovyan
[I 14:17:21.835 NotebookApp] Jupyter Notebook 6.4.3 is running at:
[I 14:17:21.835 NotebookApp] http://7f3100bc5b0b:8888/?token=1eee2aee8a3fcda212f056af931a14b7dd5490846627c122
[I 14:17:21.835 NotebookApp] or http://127.0.0.1:8888/?token=1eee2aee8a3fcda212f056af931a14b7dd5490846627c122
[I 14:17:21.835 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 14:17:21.838 NotebookApp]
To access the notebook, open this file in a browser:
file:///home/jovyan/.local/share/jupyter/runtime/nbserver-8-open.html
Or copy and paste one of these URLs:
http://7f3100bc5b0b:8888/?token=1eee2aee8a3fcda212f056af931a14b7dd5490846627c122
or http://127.0.0.1:8888/?token=1eee2aee8a3fcda212f056af931a14b7dd5490846627c122
When I open the browser with the link I get
This site can’t be reached The webpage at http://127.0.0.1:8888/?token=8543b16468608a7d26b8183256a97ebc3df41bf8838a3729 might be temporarily down or it may have moved permanently to a new web address.
ERR_SOCKET_NOT_CONNECTED
Docker compose command and output (works)
I have a docker-compose.yml file with
version: "3.2"
services:
jupyter: # you can change this "jupyter" service to whatever you want.
build:
context: ./docker-folder # this is where the build directory is aka. Dockerfile.
image: compose-test
volumes:
- "./:/home/jovyan"
ports:
- "8888:8888"
A Dockerfile with the following contents in a folder called docker-folder
FROM jupyter/minimal-notebook:notebook-6.4.3
In the terminal, I use the following commands
docker-compose build && docker-compose up
The jupyter notebook opens in the web browser with no problems. The output in the terminal is the following
Creating network "desktop_default" with the default driver
Creating desktop_jupyter_1 ... done
Attaching to desktop_jupyter_1
jupyter_1 | WARN: Jupyter Notebook deprecation notice https://github.com/jupyter/docker-stacks#jupyter-notebook-deprecation-notice.
jupyter_1 | Executing the command: jupyter notebook
jupyter_1 | [W 2021-08-31 14:25:26.648 LabApp] 'ip' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
jupyter_1 | [W 2021-08-31 14:25:26.648 LabApp] 'port' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
jupyter_1 | [W 2021-08-31 14:25:26.648 LabApp] 'port' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
jupyter_1 | [W 2021-08-31 14:25:26.648 LabApp] 'port' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
jupyter_1 | [I 2021-08-31 14:25:26.654 LabApp] JupyterLab extension loaded from /opt/conda/lib/python3.9/site-packages/jupyterlab
jupyter_1 | [I 2021-08-31 14:25:26.654 LabApp] JupyterLab application directory is /opt/conda/share/jupyter/lab
jupyter_1 | [I 14:25:26.659 NotebookApp] Serving notebooks from local directory: /home/jovyan
jupyter_1 | [I 14:25:26.659 NotebookApp] Jupyter Notebook 6.4.3 is running at:
jupyter_1 | [I 14:25:26.659 NotebookApp] http://bf12dc888bfb:8888/?token=8376064cc9487deacb8182d280bb07dba6740a69cf890581
jupyter_1 | [I 14:25:26.659 NotebookApp] or http://127.0.0.1:8888/?token=8376064cc9487deacb8182d280bb07dba6740a69cf890581
jupyter_1 | [I 14:25:26.659 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
jupyter_1 | [C 14:25:26.663 NotebookApp]
jupyter_1 |
jupyter_1 | To access the notebook, open this file in a browser:
jupyter_1 | file:///home/jovyan/.local/share/jupyter/runtime/nbserver-7-open.html
jupyter_1 | Or copy and paste one of these URLs:
jupyter_1 | http://bf12dc888bfb:8888/?token=8376064cc9487deacb8182d280bb07dba6740a69cf890581
jupyter_1 | or http://127.0.0.1:8888/?token=8376064cc9487deacb8182d280bb07dba6740a69cf890581
jupyter_1 | [I 14:25:28.996 NotebookApp] 302 GET /?token=8376064cc9487deacb8182d280bb07dba6740a69cf890581 (172.23.0.1) 0.960000ms
jupyter_1 | /opt/conda/lib/python3.9/json/encoder.py:257: UserWarning: date_default is deprecated since jupyter_client 7.0.0. Use jupyter_client.jsonutil.json_default.
jupyter_1 | return _iterencode(o, 0)
Then I close it all down with
docker-compose down -v
ANSWER: Apparently, this problem is caused by my VPN (I use Express VPN but not sure if also applies to other VPNs). Everything works fine if I turn my computer on and do docker run .... If I turn my VPN on, the error will occur. Even if I turn my VPN off, the error will continue to occur. However, if I restart my computer and do the docker run command again, everything works completely fine.
I'm not sure why but I never get errors when I use my docker-compose file, it always works.

In Jupyter docker , cannot connect to kernel

When installing Jupyter docker, for example this one :
docker run -d \
--hostname jupyterhub-ds \
--log-opt max-size=50m \
-p 8000:8000 \
-p 5006:5006 \
-e DOCKER_USER=$(id -un) \
-e DOCKER_USER_ID=$(id -u) \
-e DOCKER_PASSWORD=$(id -un) \
-e DOCKER_GROUP_ID=$(id -g) \
-e DOCKER_ADMIN_USER=$(id -un) \
-v "$(pwd)":/workdir \
-v "$(dirname $HOME)":/home_host \
dclong/jupyterhub-ds /scripts/sys/init.sh
JupyterLab starts well and I enter the lab. through URL+port.
However, this is not possible to connect to the inernal python kernel (connection is hanging up).
What kind of security I am facing ?
Is this related to socket communication security ?
After Investigation, I have those messages :
[D 16:01:39.488 NotebookApp] Starting kernel: ['/usr/local/bin/python', '-m', 'ipykernel_launcher', '-f', '/root/.local/share/jupyter/runtime/kernel-f0420fbf-12e918f-20df7d3e804a.json']
[D 16:01:39.491 NotebookApp] Connecting to: tcp://127.0.0.1:51775
[D 16:01:39.491 NotebookApp] Connecting to: tcp://127.0.0.1:38609
[I 16:01:39.492 NotebookApp] Kernel started: f0420fbf-12ef-403e-918f-20df7d3e804a
[D 16:01:39.492 NotebookApp] Kernel args: {'kernel_name': 'python3', 'cwd': '/'}
[D 16:01:39.493 NotebookApp] Clearing buffer for 5e93046f-aa3e-4edd-a018-66b9d4c752e5
[I 16:01:39.493 NotebookApp] Kernel shutdown: 5e93046f-aa3e-4edd-a018-66b9d4c752e5
It seems linked to this one :
https://jupyter-notebook.readthedocs.io/en/stable/public_server.html
Firewall Setup
To function correctly, the firewall on the computer running the jupyter notebook server must be configured to allow connections from client machines
on the access port c.NotebookApp.port set in jupyter_notebook_config.py to allow connections to the web interface.
The firewall must also allow connections from 127.0.0.1 (localhost) on ports from 49152 to 65535. These ports are used by the server to communicate with the notebook kernels.
The kernel communication ports are chosen randomly by ZeroMQ,
and may require multiple connections per kernel, so a large range of ports must be accessible.
I'm not sure how you built the docker command, or why you chose that particular Docker image dclong/jupyterhub?
If it is designed to run jupyterhub (multiuser) then it doesn't sound like what you need if you're trying to run your own Jupyter server in docker, just for you.
I would suggest using something like jupyter/scipy-notebook instead that is designed just to run one Jupyter server.
Otherwise, please describe what you actually want to get running, or why you believe you need to use that image etc.

How to mount a local folder using docker image for Jupyter notebook?

I use docker image below:
https://hub.docker.com/r/gw000/keras-full
It works great; however, I want to mount a local folder so I can save and use local notebook files. I use command below:
docker run -d -p 8888:8888 -v c:/Jupyter:/srv gw000/keras-full
The command runs successfully; however, I cannot create a new notebook because I get an error message below:
Permission denied: Untitled.ipynb
I've tried the following:
I've given "FULL" access permission to Jupter folder("everyone" user)
I've tried command from the first submitted answer
I've tried Firefox and Edge browsers using normal and admin modes
Docker image requires password "keras" as per example below:
docker run -d -p 8888:8888 -v $(pwd):/srv gw000/keras-full
I'm not able to figure out how to use mapping folder and password at the same time.
My Environment:
Windows 10 Pro
Docker Desktop
Docker logs:
[I 10:35:10.240 NotebookApp] Writing notebook server cookie secret to /home/user/.local/share/jupyter/runtime/notebook_cookie_secret
[W 10:35:10.844 NotebookApp] WARNING: The notebook server is listening on all IP addresses and not using encryption. This is not recommended.
[I 10:35:13.007 NotebookApp] jupyter_tensorboard extension loaded.
[I 10:35:13.009 NotebookApp] Serving notebooks from local directory: /srv
[I 10:35:13.009 NotebookApp] 0 active kernels
[I 10:35:13.009 NotebookApp] The Jupyter Notebook is running at:
[I 10:35:13.009 NotebookApp] http://[all ip addresses on your system]:8888/?token=...
[I 10:35:13.009 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[I 10:35:18.003 NotebookApp] 302 GET / (172.17.0.1) 0.50ms
[I 10:35:18.015 NotebookApp] 302 GET /tree? (172.17.0.1) 0.97ms
[I 10:35:21.563 NotebookApp] 302 POST /login?next=%2Ftree%3F (172.17.0.1) 1.40ms
[I 10:35:26.118 NotebookApp] Creating new notebook in
[I 10:35:26.151 NotebookApp] Writing notebook-signing key to /home/user/.local/share/jupyter/notebook_secret
[W 10:35:26.166 NotebookApp] 403 POST /api/contents (172.17.0.1): Permission denied: Untitled.ipynb
[W 10:35:26.166 NotebookApp] Permission denied: Untitled.ipynb
[W 10:35:26.167 NotebookApp] 403 POST /api/contents (172.17.0.1) 49.41ms referer=http://localhost:8880/tree?
[I 10:36:38.981 NotebookApp] 302 GET /tree (172.17.0.1) 1.66ms
[I 10:36:42.373 NotebookApp] 302 POST /login?next=%2Ftree (172.17.0.1) 1.12ms
[I 10:36:45.459 NotebookApp] Creating new notebook in
[W 10:36:45.475 NotebookApp] 403 POST /api/contents (172.17.0.1): Permission denied: Untitled.ipynb
[W 10:36:45.476 NotebookApp] Permission denied: Untitled.ipynb
[W 10:36:45.476 NotebookApp] 403 POST /api/contents (172.17.0.1) 18.42ms referer=http://localhost:8880/tree
[I 10:37:19.390 NotebookApp] Creating new notebook in
[W 10:37:19.410 NotebookApp] 403 POST /api/contents (172.17.0.1): Permission denied: Untitled.ipynb
[W 10:37:19.410 NotebookApp] Permission denied: Untitled.ipynb
[W 10:37:19.411 NotebookApp] 403 POST /api/contents (172.17.0.1) 21.50ms referer=http://localhost:8880/tree
First:
docker run -d -p 8888:8888 -v $(pwd):/srv gw000/keras-full
The above command is to mount the current directory using "pwd" Linux command ("pwd" as in print current directory) to the folder "/srv" inside the container. It has nothing to do with changing the password.
Secondly:
It seems to me here you are using folder "c:/Jupyter" to mount into the container folder. You might need to run Docker as administrator or you can mount from others drive that doesn't need administrator permission like drive d:/.
So then you might try:
docker run -d -p 8888:8888 -v d:/Jupyter:/srv gw000/keras-full
After seeing the Dockerfile at https://hub.docker.com/r/gw000/keras-full/dockerfile, I think your Docker is mounting the /srv as "root" user and the service is running under user "user", so you have to exec into the container by docker exec -it <name_or_id_of_container> bash and run chown -R user:user /home/user /srv
One option is to map your local user to the docker user using -u e.g.
docker run -u $(id -u):$(id -u) ...

Cannot see Ipython notebook interface on a browser using Docker Kitematic

I found data science environment image on Kitematic and so I installed and tried use it. But Although I could successfully ran and logs say that
The IPython Notebook is running at: https://[all ip addresses on your system]:8888/
, I cannot open localhost:8888. Could someone help?
Docker port:8888
MAC IP port: 192.168.99.100:32768
Below is Container log on Kitematic.
Generating a 2048 bit RSA private key
...................................+++
........................................................+++
writing new private key to '/key.pem'
-----
[W 22:46:12.956 NotebookApp](B Unrecognized alias: '--matplotlib=inline', it will probably have no effect.
[I 22:46:12.966 NotebookApp](B Writing notebook server cookie secret to /root/.ipython/profile_default/security/notebook_cookie_secret
[I 22:46:12.968 NotebookApp](B Using MathJax from CDN: https://cdn.mathjax.org/mathjax/latest/MathJax.js
[I 22:46:13.013 NotebookApp](B Serving notebooks from local directory: /notebooks
[I 22:46:13.015 NotebookApp](B 0 active kernels
[I 22:46:13.015 NotebookApp](B The IPython Notebook is running at: https://[all ip addresses on your system]:8888/
[I 22:46:13.016 NotebookApp](B Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[W 22:46:49.788 NotebookApp](B SSL Error on 7 ('192.168.99.1', 63676): [Errno 1] _ssl.c:510: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number
[E 22:46:49.797 NotebookApp](B Uncaught exception
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/tornado/http1connection.py", line 693, in _server_request_loop
ret = yield conn.read_response(request_delegate)
File "/usr/local/lib/python2.7/dist-packages/tornado/gen.py", line 870, in run
value = future.result()
File "/usr/local/lib/python2.7/dist-packages/tornado/concurrent.py", line 215, in result
raise_exc_info(self._exc_info)
File "/usr/local/lib/python2.7/dist-packages/tornado/gen.py", line 876, in run
yielded = self.gen.throw(*exc_info)
File "/usr/local/lib/python2.7/dist-packages/tornado/http1connection.py", line 168, in _read_message
quiet_exceptions=iostream.StreamClosedError)
File "/usr/local/lib/python2.7/dist-packages/tornado/gen.py", line 870, in run
value = future.result()
File "/usr/local/lib/python2.7/dist-packages/tornado/concurrent.py", line 215, in result
raise_exc_info(self._exc_info)
File "<string>", line 3, in raise_exc_info
SSLError: [Errno 1] _ssl.c:510: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number
If you are not on Linux, you would need to port-forward 8888 to your actual host (Windows or Mac) through the VM.
See "Connect to a Service running inside a docker container from outside"
VBoxManage controlvm "default" natpf1 "tcp-port8888,tcp,,8888,,8888"
VBoxManage controlvm "default" natpf1 "udp-port8888,udp,,8888,,8888"
(Replace default with the name of your docker-machine: see docker-machine ls)
You can also try and use directly the IP of your docker machine:
docker-machine IP <name of VM>

Resources