How to kill used docker port

I try to run one docker image and it says the address is already in use

driver failed programming external connectivity on endpoint jovial_saha (c79c98cbcef6340cd7867571278f401c9cbea1fd7137a39fe5d7de1c454d4e6e): Error starting userland proxy: listen tcp 0.0.0.0:9042: bind: address already in use. 

However, I deleted all containers and images, and then even if I call to launch my image

 docker run -d -p 9042:9042 myimage . i get above error. what should i do ? 
+6
source share
2 answers

To deploy Robert Moskal’s answer, you will need to kill everything that is already on this port:

  • destroy all containers again.
  • If you are on Linux, kill the process running on your port with fuser -k 9042/tcp
  • If the above steps do not work, restart your computer and try again.

Happy hunt!

+6
source

I used sudo . it worked.

 sudo fuser -k 9042/tcp 

I check the status port:

 $ netstat -pna | grep 9042 (Not all processes could be identified, non-owned process info will not be shown, you would have to be root to see it all.) 
0
source

All Articles