需要先安装docker,具体方法参考我的上一篇文章。
1. 查看本地镜像docker imagesD:go 练习go-zero-demo>docker images REPOSITORY TAG IMAGE ID CREATED SIZE alpine/git latest c6b70534b534 3 months ago 27.4MB hello-world latest feb5d9fea6a5 5 months ago 13.3kB2. 在cmd里输入:docker search jupyterhub,查看docker hub上相关的镜像文件
D:go 练习go-zero-demo>docker search jupyterhub NAME DEscriptION STARS OFFICIAL AUTOMATED jupyterhub/jupyterhub JupyterHub: multi-user Jupyter notebook serv… 305 [OK] jupyterhub/singleuser single-user docker images for use with Jupyt… 42 [OK] jupyterhub/k8s-hub 17 jupyterhub/k8s-singleuser-sample 8 bitnami/jupyterhub 8 jupyterhub/jupyterhub-onbuild onbuild version of JupyterHub images 6 jupyterhub/configurable-http-proxy node-http-proxy + REST API 5 [OK] jupyterhub/systemuser system-user image for use with JupyterHub an… 3 [OK] jupyterhub/k8s-binderhub 3 labshare/jupyterhub JupyterHub server for Kubernetes with OAuth … 3 jupyterhub/k8s-image-awaiter 1 jupyterhub/k8s-secret-sync 1 jupyterhub/k8s-pod-culler 1 jupyterhub/k8s-image-cleaner 1 jupyterhub/k8s-pre-puller 1 jupyterhub/k8s-network-tools 1 jupyterhub/jupyterhub-demo 0 pachyderm/jupyterhub-pachyderm-user 0 jupyterhub/mybinder.org-tc-init 0 pachyderm/jupyterhub-pachyderm-hub 0 jupyterhub/mybinder.org-federation-redirect 0 jupyterhub/mybinder.org-minesweeper 0 jupyterhub/mybinder.org-proxy-patches 0 jupyterhub/mybinder.org-analytics-publisher 0 jupyterhub/binderhub-ci-repos_minimal-dockerfile The minimal Dockerfile that would work with … 03. 拉取镜像文件docker pull jupyterhub
D:go 练习go-zero-demo>docker pull jupyterhub/jupyterhub Using default tag: latest latest: Pulling from jupyterhub/jupyterhub 54ee1f796a1e: Pull complete f7bfea53ad12: Pull complete 46d371e02073: Pull complete b66c17bbf772: Pull complete 44bfe3e8a19f: Pull complete 272415e84c73: Pull complete 6ae28b16fe2b: Pull complete b9e74140c7b6: Pull complete 7ee24536bcb0: Pull complete 29d58fb561ea: Pull complete ab11d07d88fe: Pull complete Digest: sha256:678b508405f938a1564a81f2d4327ada0b079452ede5a7e57ae358f88fe27a3b Status: Downloaded newer image for jupyterhub/jupyterhub:latest docker.io/jupyterhub/jupyterhub:latest4. 查看本地镜像docker images
D:go 练习go-zero-demo>docker images REPOSITORY TAG IMAGE ID CREATED SIZE jupyterhub/jupyterhub latest 1cd4fbaf4648 4 weeks ago 355MB alpine/git latest c6b70534b534 3 months ago 27.4MB hello-world latest feb5d9fea6a5 5 months ago 13.3kB5. 运行一个jupyterhub容器 ,docker run jupyterhub/jupyterhub
D:go 练习go-zero-demo>docker run jupyterhub/jupyterhub [I 2022-02-28 01:57:11.863 JupyterHub app:2766] Running JupyterHub version 2.1.1 [I 2022-02-28 01:57:11.864 JupyterHub app:2796] Using Authenticator: jupyterhub.auth.PAMAuthenticator-2.1.1 [I 2022-02-28 01:57:11.864 JupyterHub app:2796] Using Spawner: jupyterhub.spawner.LocalProcessSpawner-2.1.1 [I 2022-02-28 01:57:11.864 JupyterHub app:2796] Using Proxy: jupyterhub.proxy.ConfigurableHTTPProxy-2.1.1 [I 2022-02-28 01:57:11.871 JupyterHub app:1651] Writing cookie_secret to /srv/jupyterhub/jupyterhub_cookie_secret [I 2022-02-28 01:57:11.888 alembic.runtime.migration migration:201] Context impl SQLiteImpl. [I 2022-02-28 01:57:11.889 alembic.runtime.migration migration:204] Will assume non-transactional DDL. [I 2022-02-28 01:57:11.905 alembic.runtime.migration migration:615] Running stamp_revision -> 833da8570507 [I 2022-02-28 01:57:12.022 JupyterHub proxy:496] Generating new CONFIGPROXY_AUTH_TOKEN [I 2022-02-28 01:57:12.049 JupyterHub app:1924] Not using allowed_users. Any authenticated user will be allowed. [I 2022-02-28 01:57:12.073 JupyterHub app:2835] Initialized 0 spawners in 0.003 seconds [W 2022-02-28 01:57:12.075 JupyterHub proxy:687] Running JupyterHub without SSL. I hope there is SSL termination happening somewhere else... [I 2022-02-28 01:57:12.075 JupyterHub proxy:691] Starting proxy @ http://:8000 01:57:12.543 [ConfigProxy] info: Proxying http://*:8000 to (no default) 01:57:12.545 [ConfigProxy] info: Proxy API at http://127.0.0.1:8001/api/routes 01:57:13.051 [ConfigProxy] info: 200 GET /api/routes [I 2022-02-28 01:57:13.052 JupyterHub app:3084] Hub API listening on http://127.0.0.1:8081/hub/ 01:57:13.053 [ConfigProxy] info: 200 GET /api/routes [I 2022-02-28 01:57:13.053 JupyterHub proxy:431] Adding route for Hub: / => http://127.0.0.1:8081 01:57:13.054 [ConfigProxy] info: Adding route / -> http://127.0.0.1:8081 01:57:13.054 [ConfigProxy] info: Route added / -> http://127.0.0.1:8081 01:57:13.055 [ConfigProxy] info: 201 POST /api/routes/ [I 2022-02-28 01:57:13.055 JupyterHub app:3150] JupyterHub is now running at http://:8000其他 查看所有容器docker ps -a 参数, -i:交互式,-t:终端,-d:后台运行,-P:将容器内部使用的网络端口随机映射到我们使用的主机上。 停止容器docker stop <容器 ID> 进入后台运行容器docker attach <容器 ID> 退出但不停止容器运行docker exec <容器 ID> 删除容器docker rm <容器 ID>



