Docker and CI/CD · Junior · Question 71 of 75

docker run -p 5432:5432 postgres fails with "port is already allocated". Why?

Explanation

Perhaps a local Postgres or another container. Map a different host port, like -p 5433:5432; the container side stays the same.

Further reading

Problem with a question

Docker and CI/CD · Junior · question 71

Test yourself

Take the Docker and CI/CD · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz