我有一个 Docker 服务容器暴露于*:8080.
localhost:8080. Chrome /curl无限期挂断。127.0.0.1这让我很困惑,因为在我的hosts文件中,localhost重定向到127.0.0.1.
为什么会这样?它是否以某种方式与 IPv4/IPv6 双栈相关?
我在 PopOS(基于 Ubuntu)上,启用了 Docker Swarm。我正在使用这个测试堆栈文件,traefik.docker-compose.yml:
version: '3'
services:
reverse-proxy:
image: traefik # The official Traefik docker image
command: --api --docker # Enables the web UI and tells Traefik to listen to docker
ports:
- "80:80" # The HTTP port
- "8080:8080" # The Web UI (enabled by --api)
volumes:
- /var/run/docker.sock:/var/run/docker.sock # …Run Code Online (Sandbox Code Playgroud)