linux - Docker容器有一些奇怪的地址,03a0646cb148:8888/任何人都可以解释这种地址的类型吗?

标签 linux docker ip

我正在运行一个有两个不同地址的容器,我了解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/

相关文章:

docker - 为特定的Docker容器Debian设置max_map_count

android - 连接到蜂窝网络时获取 Android 的 IP 地址

linux - 使用awk测量同一列中2个数字之间的差异

java - 使用 Java/Shell 下载 github 版本

macos - Mac 上的 Boot2Docker - 返回 bsdthread_register 错误

ios - 如何在 NETunnelProviderManager 中找出 IP 流量的源进程

php - 限制网站访问特定国家

linux - else 字符串匹配在 expect 中

linux - 创建自定义 Vim 命令以在 bash 配置文件中运行函数

docker - apt-get update 失败,但退出状态仍然成功,这破坏了我的 docker 缓存