我正在使用docker,所以我通过这个命令行docker run -d --restart=always -p 8080:8080 rancher/server
使用了牧场主/服务器我检查了docker containers(docker ps -a
)我发现这个:
dc191cba6ce8 rancher/server "/usr/bin/s6-svscan /" 10 minutes ago Up 27 seconds 3306/tcp, 0.0.0.0:8080->8080/tcp naughty_almeida
iptables内容:
Chain ufw-user-input (1 references)
target prot opt source destination
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:8080
ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:8080
看起来很好,但我无法访问rancher ui页面:
http://IP:8080
docker logs dc191cba6ce8:
2016-07-19 17:58:55,936 INFO [main] [ConsoleStatus] [1/32] [0ms] [0ms] Loading bootstrap
2016-07-19 17:58:56,267 INFO [main] [ConsoleStatus] [2/32] [330ms] [329ms] Loading config-defaults
2016-07-19 17:59:09,243 INFO [main] [ConsoleStatus] [3/32] [13307ms] [12976ms] Loading system
2016-07-19 17:59:09,410 INFO [main] [ConsoleStatus] [4/32] [13474ms] [166ms] Loading defaults
2016-07-19 17:59:10,482 INFO [main] [ConsoleStatus] [5/32] [14546ms] [1072ms] Loading types
2016-07-19 17:59:21,385 INFO [main] [ConsoleStatus] [6/32] [25449ms] [10902ms] Loading system-services
2016-07-19 17:59:22,058 INFO [main] [ConsoleStatus] [7/32] [26122ms] [673ms] Loading agent-server
2016-07-19 17:59:22,794 INFO [main] [ConsoleStatus] [8/32] [26858ms] [736ms] Loading allocator-server
答案 0 :(得分:2)
DEBUG(所有评论/聊天摘要): 首先,我们检查了它是否是端口映射问题:
docker inspect dc191cba6ce8 | grep IPAddress
哪个给了IP:172.17.x.x
当他能够curl 172.17.x.x:8080
输出时:
这必须返回类似:
{"type":"collection","resourceType":"apiVersion","links":{"self":"http://172.17.0.6:8080/","latest":"http://172.17.0.6:8080/v1"},"createTypes":{},"actions":{},"data":[{"id":"v1","type":"apiVersion","links":{"self":"http://172.17.0.6:8080/v1"},"actions":{}}],"sortLinks":{},"pagination":null,"sort":null,"filters":{},"createDefaults":{}}
首先我们考虑了端口映射问题。但是,在重新检查日志后,我发现容器启动存在问题:
docker logs dc191cba6ce8
的输出显示:
2016-07-19 17:58:55,936 INFO [main] [ConsoleStatus] [1/32] [0ms] [0ms] Loading bootstrap
2016-07-19 17:58:56,267 INFO [main] [ConsoleStatus] [2/32] [330ms] [329ms] Loading config-defaults
2016-07-19 17:59:09,243 INFO [main] [ConsoleStatus] [3/32] [13307ms] [12976ms] Loading system
2016-07-19 17:59:09,410 INFO [main] [ConsoleStatus] [4/32] [13474ms] [166ms] Loading defaults
2016-07-19 17:59:10,482 INFO [main] [ConsoleStatus] [5/32] [14546ms] [1072ms] Loading types
2016-07-19 17:59:21,385 INFO [main] [ConsoleStatus] [6/32] [26858ms] [736ms] Loading allocator-server
然后停了下来。所以容器启动存在问题。这是因为服务器只有512MB的RAM。 在dockerhub上是运行游侠容器的一些先决条件:
RAM: 1GB+
因此,在创建一个更大的服务器(或在本地执行)之后,它能够以适当的方式启动容器并在浏览器中访问控制台。
答案 1 :(得分:0)
只需在浏览器中键入dockerhost:{here 443},如果您使用的是代理,请将其禁用。