I’m trying to start postgres in a docker container on my Mac, but I keep getting the following error message
docker: Error response from daemon: driver failed programming external connectivity on endpoint postgres (8392b9e5cfaa28f480fe1009dee461f97e82499726f4afc4e916358dd2d2f61e): Error starting userland proxy: Failed to bind tcp 0.0.0.0:5432 address already in use.
I have postgres installed locally, but I stopped it and running
pg_ctl: no server running
I’ve ran the following to check what’s running on 5432
lsof -i tcp:5432
netstat -anp tcp | grep 5432
and nothing is running on the port.
Mac – OS X El Capitan Version 10.11.2
PostgreSQL – 9.5
Docker – Docker version 1.12.0-rc2, build 906eacd, experimental
lsof -i :5432 doesn’t show you any output, you can use
sudo ss -lptn 'sport = :5432' to see what process is bound to the port.
Proceed further with