【问题标题】:Docker does not release ports after stop and remove all containerDocker停止并移除所有容器后不释放端口
【发布时间】:2017-03-02 18:01:35
【问题描述】:

在我停止并删除计算机中的所有容器后,Docker 不会释放端口绑定。 你有什么建议吗?

ricky@ricky-ubuntu:~$ sudo docker -v
Docker version 1.12.2, build bb80604
ricky@ricky-ubuntu:~$ sudo docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
ricky@ricky-ubuntu:~$ sudo netstat -nlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.1:5939          0.0.0.0:*               LISTEN      1464/teamviewerd
tcp        0      0 127.0.1.1:53            0.0.0.0:*               LISTEN      1487/dnsmasq    
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      3623/cupsd      
tcp        0      0 127.0.0.1:8000          0.0.0.0:*               LISTEN      2771/docker-proxy
tcp        0      0 127.0.0.1:27017         0.0.0.0:*               LISTEN      1196/mongod     
tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN      1325/mysqld     
tcp        0      0 0.0.0.0:5900            0.0.0.0:*               LISTEN      3485/vino-server
tcp6       0      0 :::9999                 :::*                    LISTEN      2597/docker-proxy
tcp6       0      0 :::80                   :::*                    LISTEN      2787/docker-proxy
tcp6       0      0 :::8080                 :::*                    LISTEN      2755/docker-proxy
tcp6       0      0 :::7091                 :::*                    LISTEN      2763/docker-proxy
tcp6       0      0 ::1:631                 :::*                    LISTEN      3623/cupsd      
tcp6       0      0 :::443                  :::*                    LISTEN      2779/docker-proxy
tcp6       0      0 :::9888                 :::*                    LISTEN      2737/docker-proxy
tcp6       0      0 :::9889                 :::*                    LISTEN      2728/docker-proxy
tcp6       0      0 :::9090                 :::*                    LISTEN      2745/docker-proxy
tcp6       0      0 :::5800                 :::*                    LISTEN      3485/vino-server
tcp6       0      0 :::5900                 :::*                    LISTEN      3485/vino-server
tcp6       0      0 :::9997                 :::*                    LISTEN      2719/docker-proxy

【问题讨论】:

  • 重启泊坞窗? :) 一直为我工作。
  • 我已经用 sudo service docker restart 重新启动了 docker-engine(然后重新启动了机器),但它仍然没有工作。
  • 你做了 以确保它什么都不显示吗?有时,悬空的容器可以使用端口。
  • 是的,我做到了。你可以看到上面的输出。 完全为空。
  • 我也有同样的问题。我停止所有容器,运行service docker restartdocker container prune。但是 netstat 显示我的端口:/.

标签: docker binding port


【解决方案1】:

如果“docker-compose down”或停止和删除容器没有帮助,我退出 docker,然后检查 docker.backend 是否仍在运行(Windows 为 com.docker.backend.exe)。 终止该服务可以释放我的端口。

另一种方法是在设置中“重置为出厂默认设置”。但这应该是最后使用的解决方案,直到它删除您在 Docker 中设置的所有内容。

【讨论】:

  • 并且,在尝试@Dagger87的解决方案后,尝试终止Java.exeOpenJDK可疑的所有进程。这可能行得通。
猜你喜欢
  • 2018-01-03
  • 1970-01-01
  • 1970-01-01
  • 2018-01-20
  • 2016-02-21
  • 2021-12-23
  • 2016-03-17
  • 1970-01-01
相关资源
最近更新 更多