Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

447
Views
docker postgres failed to start with specified port

I'm new to docker and I'm trying to run a postgres database docker with the following command :

docker run --name rva-db  -e POSTGRES_PASSWORD=rva -e POSTGRES_DB=rva-db -d postgres -p 5432:5432

If I'm trying to run it without the -p option, it seems to work fine, but I can't reach it from my local pg-admin, I thought I need to add the port link to reach it.

Anyway, the container always crash after few seconds and when i'm trying to start it with the start command I'm getting the following return :

docker start -a rva-db
FATAL:  invalid value for parameter "port": "5432:5432"

What did I miss ?

FYI, I'm running it on a MacOS with the following docker version :

$ docker version
 Client:
  Version:      1.12.1
  API version:  1.24
  Go version:   go1.7.1
  Git commit:   6f9534c
  Built:        Thu Sep  8 10:31:18 2016
  OS/Arch:      darwin/amd64

 Server:
  Version:      1.12.1
  API version:  1.24
  Go version:   go1.6.3
  Git commit:   23cf638
  Built:        Thu Aug 18 17:52:38 2016
  OS/Arch:      linux/amd64
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Run the container typing -p option before the image name

docker run --name rva-db  -e POSTGRES_PASSWORD=rva -e POSTGRES_DB=rva-db -d -p 5432:5432 postgres

As for Docker run reference docker run has this format

docker run [OPTIONS] IMAGE[:TAG|@DIGEST] [COMMAND] [ARG...]

Options must be before image name. After that you can set entrypoint or command (when theyy differ from default from Dockerfile) and their arguments.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!