0

我正在使用 docker,所以我通过这个命令行使用了 rancher/serverdocker run -d --restart=always -p 8080:8080 rancher/server我检查了 docker 容器(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

看起来不错,但我无法访问牧场主 ui 页面:

http://IP:8080

码头工人日志 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
4

2 回答 2

2

调试(所有评论/聊天的摘要):首先我们检查它是否是端口映射问题:

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上有一些运行 ranger 容器的先决条件:

RAM: 1GB+ 

因此,在创建更大的服务器(或在本地进行)之后,它能够以正确的方式启动容器并访问浏览器中的控制台。

于 2016-07-19T18:54:18.073 回答
0

只需在浏览器中输入 dockerhost:{here 443} ,如果您使用的是代理,请禁用它。

于 2018-02-06T13:04:49.777 回答