我在docker上运行了beego web服务器并映射端口8080到主机8006
为什么主机浏览器无法正常显示
![Screenshot 2016-03-13 21.29.57.png](http://studygolang.qiniudn.com/160314/398b2275320751ea12107ee3950ee734.png)
![Screenshot 2016-03-13 21.31.48.png](http://studygolang.qiniudn.com/160314/7e6e2004a70a29020871c4f79c8fd88e.png)
![Screenshot 2016-03-13 21.33.42.png](http://studygolang.qiniudn.com/160314/80f3c8cab2cd8e13ef42832100a9ea60.png)
我的是mac,貌似有网络问题需要解决,需要pfctl命令和修改配置文件
docker port compassionate_poitras
显示
8080/tcp -> 0.0.0.0:8006
主机
ifconfig
en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether 10:40:f3:f0:01:cc
inet6 fe80::1240:f3ff:fef0:1cc%en1 prefixlen 64 scopeid 0x5
inet 192.168.1.101 netmask 0xffffff00 broadcast 192.168.1.255
nd6 options=1<PERFORMNUD>
media: autoselect
status: active
vboxnet1: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
ether 0a:00:27:00:00:01
inet 192.168.99.1 netmask 0xffffff00 broadcast 192.168.99.255
inet 192.168.1.101 netmask 0xffffff00 broadcast 192.168.1.255
inet 192.168.99.1 netmask 0xffffff00 broadcast 192.168.99.255
我怀疑是需要做这两个ip的forwording?
#4
更多评论
docker run -it -p 8006:8080 -v /Users/Go:/go -w /go/src/projectname golang:latest bee run
#2