我在centos6.7码头工具集合中运行jboss5。访问码头集装箱内的jboss 8080端口
JBoss上运行使用run.sh -b 0.0.0.0
命令 集装箱使用docker run -i -t -p 8080:8080 my/jboss /bin/bash
这是我在容器看到运行
[[email protected] bin]# netstat -alnt
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:8009 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:8083 0.0.0.0:* LISTEN
这是我在主机上看到
15:04:17:(~)$ sudo docker ps
[sudo] password for c0rp:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e44f2bbab31a my/jboss "/bin/bash" 4 hours ago Up 4 hours 0.0.0.0:8080->8080/tcp thirsty_franklin
当我试图从主机访问jboss应用程序通过localhost:8080
我看到ERROR 404: Not Found.
当我检查本地主机:从容器内使用wget
8080我看到同样的错误ERROR 404: Not Found.
一切都OK了,如果我使用的容器的IP地址。问题是我如何将主机localhost:8080绑定到容器ip_address:8080?