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 status
returns
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
Docker is an open platform for developing, shipping, and running applications. Docker enables you to separate your applications from your infrastructure so you can deliver software quickly. With Docker, you can manage your infrastructure in the same ways you manage your applications.
Docker is a company which provides a set of tools for building and sharing container images, and running containers at both small and large scale. Kubernetes is a tool which manages (“orchestrates”) container-based applications running on a cluster of servers.
The main distinction between these two technologies is that VMs run as virtual environments on the same hardware, whereas Docker runs on virtualizations of the same operating system.
In simple terms, Docker is a software platform that simplifies the process of building, running, managing and distributing applications. It does this by virtualizing the operating system of the computer on which it is installed and running. The first edition of Docker was released in 2013.
If 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 kill <pid>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With