Skip to content

Cannot connect to database when creating new container #983

@taro54071

Description

@taro54071

docker run -it \ -e POSTGRES_USER="root" \ -e POSTGRES_PASSWORD="root" \ -e POSTGRES_DB="ny_taxi" \ -v $(pwd)/ny_taxi_postgres_data:/var/lib/postgresql/data \ -p 5432:5432 \ postgres:13

Here is the command that I use to create database.
When container has been created, another folder with similar name appears on my directory. Also, there is no file in my "ny_taxi_postgres_data" directory.
image
"ny_taxi_postgres_data;C" is the duplicate directory.

Then I try to access to the database by using pgcli with this command, it gives me this result.
image

This is the opened directory and network. I hope this can help to solve my issue.
image
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionUsability question, not directly related to an error with the image

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions