码迷,mamicode.com
首页 > 其他好文 > 详细

docker: Error response from daemon: Ports are not available

时间:2020-09-24 22:17:37      阅读:232      评论:0      收藏:0      [点我收藏+]

标签:available   was   哪些   forbidden   tran   erro   windows   错误提示   ras   

在使用 docker 部署 zookeeper 时,出现错误提示。

docker run -d -p 2181:2181 --name=zookeeper --privileged zookeeper

错误提示:
docker: Error response from daemon: Ports are not available: listen tcp 0.0.0.0:2181: bind: An attempt was made to access a socket in a way forbidden by its access permissions.

2181 端口不让用

使用命令
netsh interface ipv4 show excludedportrange protocol=tcp
可以查看哪些端口不让用

技术图片

最简单的处理方式:不让用,就不用咯。

// 修改暴露端口为 3181
docker run -d -p 3181:2181 --name=zookeeper --privileged zookeeper

参考文章:

Ports are not available: listen tcp 0.0.0.0:3000: bind: An attempt was made to access a socket in a way forbidden by its access permissions. | by Jihoon Park | Medium

至于为什么不让用,可以参看:
Unable to bind ports: Docker-for-Windows & Hyper-V excluding but not using important port ranges · Issue #3171 · docker/for-win

原文链接:https://www.cnblogs.com/jasongrass/p/13726009.html

docker: Error response from daemon: Ports are not available

标签:available   was   哪些   forbidden   tran   erro   windows   错误提示   ras   

原文地址:https://www.cnblogs.com/jasongrass/p/13726009.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!