错误信息
Error invoking remote method 'docker-start-container': Error: (HTTP code 500) server error - Ports are not available: exposing port TCP 0.0.0.0:3306 -> 0.0.0.0:0: listen tcp 0.0.0.0:3306: bind: An attempt was made to access a socket in a way forbidden by its access permissions.
解决方案
- 判断wsl中端口是否占用, 如果端口被占用kill调指定进程再启动。
sudo lsof -i :端口号
- 判断Hyper-V 是否保留了部分指定端口
查看端口保留信息,如果在表中没有找到我们需要的端口那么需要手动添加指定端口
netsh interface ipv4 show excludedportrange protocol=tcp
添加指定端口到hyper-v中
netsh int ipv4 add excludedportrange protocol=tcp startport=3306 numberofports=1 store=persistent
标签:0.0,端口,wsl,tcp,出错,3306,docker
From: https://www.cnblogs.com/lyraHeartstrings/p/17581685.html