Docker容器端口问题

时间:2016-01-04 06:43:59

标签: docker raspberry-pi minecraft raspbian

我在raspbian jessie 8(IP 192.168.2.2)上安装了docker。我创建了一个带有raspcraft基础映像的docker容器,并安装了我的Minecraft。我在容器上打开了端口25565

pi@raspberrypi ~ $ docker run -d -p 25565:25565 rpi_minecraft

pi@raspberrypi ~ $ docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                              NAMES
b94381cdc3b6        rpi_minecraft       "supervisord -c /etc/"   About an hour ago   Up About an hour    80/tcp, 0.0.0.0:25565->25565/tcp   pensive_shockley

当我尝试查看该端口是否已打开时,我收到此错误

Andrews-iMac:~ Andrew$ telnet 192.168.2.2 25565
Trying 192.168.2.2...
telnet: connect to address 192.168.2.2: Connection refused
telnet: Unable to connect to remote host

导致此问题的原因是什么?所有相关的港口对我开放?

1 个答案:

答案 0 :(得分:0)

因为你打开端口25565但是用telnet测试了端口80。

telnet 192.168.2.2 25565