我正在运行一个有两个不同地址的容器,我了解http://127.0.0.1:8888/?token=..。和:: 1分别指的是ipv4和6中的本地主机,但是此http:// 03a0646cb148:8888 /?token = ...地址来自哪里?
lib@DESKTOP-ISQPMPU:~$ docker run --rm -p 8888:8888 -v $PWD:/home/jovyan/pwd --env JUPYTER_ENABLE_LAB=yes --env JUPYTER_TOKEN=x --name ihaskell_notebook crosscompass/ihaskell-notebook:latest
[sudo] password for lib:
Executing the command: jupyter lab
[I 15:35:31.698 LabApp] Writing notebook server cookie secret to /home/jovyan/.local/share/jupyter/runtime/notebook_cookie_secret
[I 15:35:34.001 LabApp] JupyterLab extension loaded from /opt/conda/lib/python3.7/site-packages/jupyterlab
[I 15:35:34.001 LabApp] JupyterLab application directory is /opt/conda/share/jupyter/lab
[I 15:35:34.006 LabApp] Serving notebooks from local directory: /home/jovyan
[I 15:35:34.006 LabApp] The Jupyter Notebook is running at:
[I 15:35:34.006 LabApp] http://03a0646cb148:8888/?token=...
[I 15:35:34.006 LabApp] or http://127.0.0.1:8888/?token=...
[I 15:35:34.006 LabApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
最佳答案
where does this http://03a0646cb148:8888/?token=... address comes from ?
那是一个容器的主机名。 docker使用的Linux命名空间之一是UTS,它最容易被认为是主机名。容器中的主机名默认为短容器ID:
$ docker run -it --name test-host busybox hostname
e93c238e1aa3
$ docker container ls -l
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e93c238e1aa3 busybox "hostname" About a minute ago Exited (0) About a minute ago test-host
$ docker container inspect test-host --format '{{.ID}}'
e93c238e1aa32b62b9c57df722ea3150a48322c266383f0d7c8e049ab7bd760c
关于linux - Docker容器有一些奇怪的地址,03a0646cb148:8888/任何人都可以解释这种地址的类型吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63981637/