You can use following command to get only pid:
sudo netstat -peanut | grep 3000 | awk '{ print $9 }' | sed 's:/[^/]*$::' | grep -Eo '[0-9]{1,5}'
awk command gets the 9-th field.
sed command gets the pid before forward slash.
And grep command returns only numbers to eliminate extra lines.
Here you can simply have a loop and kill processes.
https://stackoverflow.com/questions/37971961/docker-error-bind-address-already-in-use
To replay you need to login. Don't have an account? Sign up for one.