|
react docker-compose出错, 3000端口已分配但实质上并没有docker占用着
- ERROR: for hi_react-apps_1 Cannot start service react-apps: driver failed programming external connectivity on endpoint hi_react-apps_1 (0d929e61b9034344d154106db637471e420e82e72497ea2931029b95df7fcf2): Bind for 0.0.0.0:3000 failed: port is already allocated
复制代码 查看3000端口那个程序占用着
- netstat -vanp tcp | grep 3000
复制代码 显示并没有程序占用.
macos可用以下这个命令去查, 然后kill掉(kill -9 pid)
也可以用这个方法, alias放zshrc里
- findandkill() { port=$(lsof -n -i4TCP:$1 | grep LISTEN | awk '{ print $2 }') kill -9 $port } alias killport=findandkill
复制代码
|
|