Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/docker/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Docker can';t使用traefik'绑定到端口8080;s仪表盘_Docker_Traefik - Fatal编程技术网

Docker can';t使用traefik'绑定到端口8080;s仪表盘

Docker can';t使用traefik'绑定到端口8080;s仪表盘,docker,traefik,Docker,Traefik,我有以下traefik配置文件: debug = true logLevel = "DEBUG" [entryPoints] [entryPoints.http] address = ":80" compress = true [entryPoints.dashboard] address=":81" [entryPoints.dashboard.auth] [entryPoints.dashboard.auth.basic]

我有以下traefik配置文件:

debug = true
logLevel = "DEBUG"

[entryPoints]
  [entryPoints.http]
    address = ":80"
    compress = true

  [entryPoints.dashboard]
    address=":81"
    [entryPoints.dashboard.auth]
      [entryPoints.dashboard.auth.basic]
        users = [
          "admin:-------"
        ]

[traefikLog]

[accessLog]

[api]
dashboard = true
entryPoint = "dashboard"

[ping]

[docker]
以及docker compose中的以下路由:

- ‘5080:80’
- ‘5443:443’
- ‘5000:81’
这与示例相同,仪表板可从端口5000的外部访问

当我将仪表板端口更改为8080并将其反映在映射中(“5000:8080”)时,就会出现问题

我得到以下错误:

level=error msg="Error opening listener listen tcp :8080: bind: address already in use" 
level=fatal msg="Error preparing server: listen tcp :8080: bind: address already in use" 
问题是我看不到8080正在使用:

[root@ns3106050 ~]# lsof -i -P -n | grep LISTEN
sshd      1276   root    3u  IPv4    515      0t0  TCP *:22 (LISTEN)
sshd      1276   root    4u  IPv6    517      0t0  TCP *:22 (LISTEN)
dockerd   1277   root    6u  IPv6   5955      0t0  TCP *:2376 (LISTEN)
docker-pr 5425   root    4u  IPv6  24484      0t0  TCP *:5443 (LISTEN)
docker-pr 5436   root    4u  IPv6  24492      0t0  TCP *:5000 (LISTEN)
docker-pr 5447   root    4u  IPv6  22391      0t0  TCP *:5080 (LISTEN)

我可能遗漏了什么?

确保没有为docker compose文件中的traefik命令指定
--api
标志。CLI和toml配置不能一起工作。

netstat-pant的输出是什么| grep8080[root@ns3106050~]#netstat-pant | grep8080->[root@ns3106050~]#它不会返回容器内或主机上的任何内容?出现此错误是因为您试图在容器内部绑定到正在使用的端口。因此,我们需要容器内的
netstat-pant | grep8080
输出