docker postgres failed to start with specified port

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.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)