Docker – Ports are not available: listen tcp 0.0.0.0/50070: bind: An attempt was made to access a socket in a way forbidden by its access permissions

dockerdocker-imagehadoopport

I am trying to start a docker container with the below command.

docker run -it -p 50070:50070 -p 8088:8088 -p 8080:8080 suhothayan/hadoop-spark-pig-hive:2.9.2 bash

It ended up with the following error.

docker: error response from daemon: Ports are not available: listen tcp 0.0.0.0/50070: bind: An attempt was made to access a socket in a way forbidden by its access permissions.

As I understand, the error has occurred as the port 50070 is used by another process. I've tried to identify the process in order to kill that with the below command in the command prompt, but it does not give an output nor an error.

netstat -ano | findstr :50080

Best Answer

This solution helped me:

net stop winnat
docker start container_name
net start winnat
Related Topic