docker - Docker 端口映射主机未侦听
问题描述
我有一个 docker 容器,其中端口映射不再起作用。在主机上:
3b0d28970e58 docker.software-univention.de/zammad-zammad-nginx:3.6.0-42 "/docker-entrypoint.…" 24 minutes ago Up 3 minutes 0.0.0.0:40001->80/tcp zammad_zammad-nginx_1
curl http://127.0.0.1:40001
curl: (56) Recv failure: Die Verbindung wurde vom Kommunikationspartner zurückgesetzt
curl http://172.16.0.249:40001
curl: (7) Failed to connect to 172.16.0.249 port 40001: Keine Route zum Zielrechner
ping 172.16.0.249
PING 172.16.0.249 (172.16.0.249) 56(84) bytes of data.
64 bytes from 172.16.0.249: icmp_seq=1 ttl=64 time=0.041 ms
nmap -sS 172.16.0.249
Starting Nmap 7.40 ( https://nmap.org ) at 2021-06-19 21:02 CEST
Nmap scan report for ucs-intranet.redacion.net (172.16.0.249)
Host is up (0.000018s latency).
Not shown: 992 closed ports
PORT STATE SERVICE
... no 40001 entry in list
netstat -tulpen | grep 40001
tcp6 0 0 :::40001 :::* LISTEN 0 1019188 18819/docker-proxy
nmap -6 -sS ::1
Starting Nmap 7.40 ( https://nmap.org ) at 2021-06-19 21:10 CEST
Nmap scan report for localhost (::1)
Host is up (0.000028s latency).
Not shown: 993 closed ports
PORT STATE SERVICE
... no 40001 entry in list
curl http://[::1]:40001
curl: (56) Recv failure: Die Verbindung wurde vom Kommunikationspartner zurückgesetzt
ping6 ::1
PING ::1(::1) 56 data bytes
64 bytes from ::1: icmp_seq=1 ttl=64 time=0.068 ms
在码头集装箱中
curl http://127.0.0.1:80
<!DOCTYPE html>
curl http://172.16.0.6:80
<!DOCTYPE html>
...
有谁知道这里有什么问题?操作系统是最新的 UCS 4(基于 Debian)。
此致,
亚历克斯
解决方案
推荐阅读
- ruby-on-rails - 从视图中使用 ransack 对多列进行排序
- kotlin - Kotlin 中的可空变量
- kubernetes - 为什么“helm install --dry-run”没有给我一个关于冲突的错误,但实际的“helm install”呢?
- amq - 带指数退避的 AMQ 消息排序
- algorithm - 构建递归算法来检查二维单词数组
- java - Google colab 上 r 脚本中的 java 问题
- go - 有没有办法在 go 中单独处理服务器连接?
- python - 通过列表递增并找到一系列切片的最大值
- javascript - vuejs 拆分为字符串到数组
- math - 如何将纹理的 UV 坐标映射到子矩形的“内部”UV 坐标?