Matheus Ferreira
Matheus Ferreira

Reputation: 23

Error creating postgres container with Docker

I'm initializing my studies with docker. When I creating the postgreSQL container with Docker, appear this error:

enter image description here

I've already reinstall docker and tried change the database port, but must be don't have success

Upvotes: 1

Views: 1066

Answers (1)

CefBoud
CefBoud

Reputation: 224

The error indicates that the 5432 port is already in use, in the HOST. This means that this port is occupied by another application. This could be for example a Postgres instance that you have on your machine or maybe another container using up this port.

The port option is -p hostPort:ContainerPort, so to have access to the Postgres port of the container which is 5432 in the host at port 5000 try:

-p 5000:5432

Upvotes: 1

Related Questions