在 Ubuntu 20.04 上运行 docker Kaggle/python

在 Ubuntu 20.04 上运行 docker Kaggle/python

我在 Ubuntu 上运行 docker Kaggle/python 时遇到警告:

  1. Docker 版本 20.10.1(内部版本 831ebea)安装在 Ubuntu 20.04 上。

  2. kaggle/python (993897c5431c) 拉取 docker pull kaggle/python

  3. 不同的运行选项:

    docker run -v ${PWD}:/tmp/working -w=/tmp/working -p 8888:8888 --rm -it kaggle/python bash -c "jupyter notebook --notebook-dir=/tmp/working --ip='*' --port=8888 --no-browser --allow-root"
    
  4. 给了我同样的警告:

    **[W 12:40:11.750 NotebookApp] Config option `allow_remote_access` not recognized by `NotebookApp`.  Did you mean one of: `allow_credentials, allow_root`?**
    
    [I 12:40:11.764 NotebookApp] Writing notebook server cookie secret to /root/.local/share/jupyter/runtime/notebook_cookie_secret
    
    **[W 12:40:12.016 NotebookApp] WARNING: The notebook server is listening on all IP addresses and not using encryption. This is not recommended.**
    
    **[W 12:40:12.016 NotebookApp] WARNING: The notebook server is listening on all IP addresses and not using authentication. This is highly insecure and not recommended.**
    
    jupyter_http_over_ws extension initialized. Listening on /http_over_websocket
    
    [I 12:40:12.969 NotebookApp] JupyterLab extension loaded from /opt/conda/lib/python3.7/site-packages/jupyterlab
    

答案1

如果你启动

docker run -v $PWD:/tmp/working -w=/tmp/working -p 8080:8080 --rm -it gcr.io/kaggle-images/python

然后你可以访问http://127.0.0.1:8080

你也可以运行

docker run -v $PWD:/tmp/working -w=/tmp/working -p 8080:8080 --rm -it gcr.io/kaggle-images/python jupyter notebook --no-browser --ip="*" --notebook-dir=/tmp/working --allow-root

相关内容