udacity / CarND-Term1-Starter-Kit

MIT License
495 stars 602 forks source link

Warning + Error - Jupyter within Docker launched as root #74

Closed JGuillaumin closed 6 years ago

JGuillaumin commented 7 years ago

I built the Docker images (both CPU and GPU). Building step : OK

But when I launch the container, it fails due to a Jupyter error about the configuration ..

docker run -it -p 8889:8888 -v "$PWD"/:/src jguillaumin/carnd-term1:cpu
[I 11:38:09.122 NotebookApp] Writing notebook server cookie secret to /root/.local/share/jupyter/runtime/notebook_cookie_secret
[W 11:38:09.152 NotebookApp] WARNING: The notebook server is listening on all IP addresses and not using encryption. This is not recommended.
[C 11:38:09.160 NotebookApp] Running as root is not recommended. Use --allow-root to bypass.

When I use --allow-root it works :

docker run -it -p 8889:8888 -v "$PWD"/:/src/ jguillaumin/carnd-term1:cpu bash
root@1e4124dc80a1:/src# jupyter notebook &
[1] 34
root@1e4124dc80a1:/src# [I 11:43:34.335 NotebookApp] Writing notebook server cookie secret to /root/.local/share/jupyter/runtime/notebook_cookie_secret
[W 11:43:34.364 NotebookApp] WARNING: The notebook server is listening on all IP addresses and not using encryption. This is not recommended.
[C 11:43:34.372 NotebookApp] Running as root is not recommended. Use --allow-root to bypass.

[1]+  Exit 1                  jupyter notebook
root@1e4124dc80a1:/src# 
root@1e4124dc80a1:/src# 
root@1e4124dc80a1:/src# jupyter notebook --allow-root &
[1] 38
root@1e4124dc80a1:/src# [W 11:43:46.661 NotebookApp] WARNING: The notebook server is listening on all IP addresses and not using encryption. This is not recommended.
[I 11:43:46.666 NotebookApp] Serving notebooks from local directory: /src
[I 11:43:46.666 NotebookApp] 0 active kernels 
[I 11:43:46.666 NotebookApp] The Jupyter Notebook is running at: http://[all ip addresses on your system]:8888/?token=94a36d6cc503122e60de4744ab892b34bf2ae2d74d4d7fdb
[I 11:43:46.666 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 11:43:46.666 NotebookApp] 

    Copy/paste this URL into your browser when you connect for the first time,
    to login with a token:
        http://localhost:8888/?token=94a36d6cc503122e60de4744ab892b34bf2ae2d74d4d7fdb
[I 13:43:52.801 NotebookApp] 302 GET /?token=94a36d6cc503122e60de4744ab892b34bf2ae2d74d4d7fdb (127.0.0.1) 0.37ms

I built the sames images few months ago .. it worked well.

Does anyone know how to change jupyter configuration to avoid this problem ?

I'm working on a local machine, I think it's not a security/vulnerability issue, but I would like to understand this problem.

Thanks

mvirgo commented 6 years ago

Looks like the fix was done back in June last year; closing out.