K
K
Kamral Magaramov2020-11-27 22:41:11
PostgreSQL
Kamral Magaramov, 2020-11-27 22:41:11

Why does it output that the port is already taken when trying to connect postgres from docker with local postgres?

Trying to connect to postgres postgres from docker from the local machine
sudo docker run -d --name pgil -p 5432: 5432 postgres

Throws:
0700bf19b7ebef5f1cbbfcbb9274e0632b9595ba047e62b15cd5557a7fb2f538
docker: the Error response from daemon: driver failed The programming external connectivity applications on endpoint of PGIL (a3212fddc8107c62b76d0ace83da730e478e6797c71116ef60a130891ec45682): the Error starting userland proxy: listen tcp 0.0.0.0:5432: bind: address already in use.
How to solve this problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Vasilyev, 2020-11-27
@vasilyevmn

Raise on a different port:
sudo docker run -d --name pgil -p 5433:5432 postgres
As a result, on 5432 you will have a local postgres, and on 5433 you will have the one in the docker.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question