问题描述
我无法连接到Docker容器的某些端口,我也不知道为什么。
我可以在端口80上到达rutorrent,但不能在其余端口上到达。 我可以毫无问题地联系到portainer。 但是,我无法到达端口8096上的Emby
这是我的Yaml文件:
---
version: "2.1"
services:
emby:
image: linuxserver/emby
container_name: emby
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/Brussels
volumes:
- /mnt/storage/emby/config:/config
- /mnt/storage/series:/data/series
- /mnt/storage/films:/data/films
- /mnt/storage/animatie:/data/animatie
ports:
- 8096:8096
devices:
- /dev/dri:/dev/dri
restart: unless-stopped
rutorrent:
image: linuxserver/rutorrent
container_name: rutorrent
environment:
- PUID=1000
- PGID=1000
volumes:
- /mnt/storage/config:/config
- /mnt/storage/downloads:/downloads
ports:
- 80:80
- 5000:5000
- 51413:51413
- 6881:6881/udp
restart: unless-stopped
portainer:
image: portainer/portainer
container_name: portainer
environment:
- PUID=1000
- PGID=1000
ports:
- 9000:9000
volumes:
- /opt/appdata/portainer:/data
- /var/run/docker.sock:/var/run/docker.sock
restart: always
这是我的docker ps
输出:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
28d047c6524b linuxserver/emby "/init" 32 seconds ago Up 30 seconds 0.0.0.0:8096->8096/tcp,8920/tcp emby
65e9be4b9b65 linuxserver/rutorrent "/init" 2 hours ago Up 49 minutes 0.0.0.0:80->80/tcp,0.0.0.0:5000->5000/tcp,0.0.0.0:51413->51413/tcp,443/tcp,0.0.0.0:6881->6881/udp rutorrent
f9210dc326df portainer/portainer "/portainer" 2 hours ago Up 49 minutes 0.0.0.0:9000->9000/tcp portainer
sudo iptables-save | grep 8096
给了我这个:
-A DOCKER -d 172.18.0.3/32 ! -i br-1c6227ffc585 -o br-1c6227ffc585 -p tcp -m tcp --dport 8096 -j ACCEPT
-A POSTROUTING -s 172.18.0.3/32 -d 172.18.0.3/32 -p tcp -m tcp --dport 8096 -j MASQUERADE
-A DOCKER ! -i br-1c6227ffc585 -p tcp -m tcp --dport 8096 -j DNAT --to-destination 172.18.0.3:8096
sudo iptables-save | grep 9000
给了我这个:
-A DOCKER -d 172.18.0.2/32 ! -i br-1c6227ffc585 -o br-1c6227ffc585 -p tcp -m tcp --dport 9000 -j ACCEPT
-A POSTROUTING -s 172.18.0.2/32 -d 172.18.0.2/32 -p tcp -m tcp --dport 9000 -j MASQUERADE
-A DOCKER ! -i br-1c6227ffc585 -p tcp -m tcp --dport 9000 -j DNAT --to-destination 172.18.0.2:9000
在主机上,我卷曲到端口8096时收到此消息
curl: (56) Recv failure: Connection reset by peer
我希望你们能有所帮助,因为我已经在这个问题上停留了几个小时。预先谢谢你
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)