# 下载 TF
docker pull docker.io/tensorflow/tensorflow
ad8f4e35de9c374192fd8c9927cd053b65516540f3cdc169eb48a83d35945c7b
# 运行 TF
docker run -idt -p 8888:8888 -p 6006:60006 tensorflow/tensorflow
# 查看 TF Container 运行情况
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ad8f4e35de9c tensorflow/tensorflow "/run_jupyter.sh -..." 3 seconds ago Up 2 seconds 6006/tcp, 0.0.0.0:8888->8888/tcp, 0.0.0.0:6006->60006/tcp nifty_spence
打开浏览器,进入 http://localhost:8888, 显示如下:
Token authentication is enabled
If no password has been configured, you need to open the notebook server with its login token in the URL, or paste it above. This requirement will be lifted if you enable a password.
The command:
jupyter notebook list
will show you the URLs of running servers with their tokens, which you can copy and paste into your browser. For example:
Currently running servers:
http://localhost:8888/?token=c8de56fa… :: /Users/you/notebooks
or you can paste just the token value into the password field on this page.
直接 docker logs ,方便快速搞得定。
docker logs ad8f4e35de9c
[I 10:43:09.919 NotebookApp] Writing notebook server cookie secret to /root/.local/share/jupyter/runtime/notebook_cookie_secret
[W 10:43:09.933 NotebookApp] WARNING: The notebook server is listening on all IP addresses and not using encryption. This is not recommended.
[I 10:43:09.941 NotebookApp] Serving notebooks from local directory: /notebooks
[I 10:43:09.942 NotebookApp] 0 active kernels
[I 10:43:09.942 NotebookApp] The Jupyter Notebook is running at: http://[all ip addresses on your system]:8888/?token=234050f3154a03356967c68e2fe47a1f555f9abce3e4e3ee
[I 10:43:09.942 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 10:43:09.943 NotebookApp]
Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
http://localhost:8888/?token=234050f3154a03356967c68e2fe47a1f555f9abce3e4e3ee
[I 10:43:22.904 NotebookApp] 302 GET / (172.17.0.1) 1.10ms
[I 10:43:22.909 NotebookApp] 302 GET /tree? (172.17.0.1) 0.97ms
[I 10:44:08.666 NotebookApp] 302 POST /login?next=%2Ftree%3F (172.17.0.1) 1.07ms
[I 10:48:19.455 NotebookApp] 302 GET / (172.17.0.1) 0.50ms
[I 10:48:37.625 NotebookApp] 302 GET / (172.17.0.1) 0.48ms
[I 10:48:37.630 NotebookApp] 302 GET /tree? (172.17.0.1) 0.92ms
利用 token=234050f3154a03356967c68e2fe47a1f555f9abce3e4e3ee 替代 URL ,访问相应网址即可。