Skip to content

Command in 04-using-3rd-party-containers not working #37

@yulexun

Description

@yulexun

I think there is a problem with a command in course 4. Under Section B.ii., there is a command to mount a volume to postgres. However, the command does not expose port number 5432. As a result, the database cannot be connected from the host machine. Here is the command:

# Create a container from the postgres container image and mount its known storage path into a volume named pgdata
docker run -it --rm -v pgdata:/var/lib/postgresql/data -e POSTGRES_PASSWORD=foobarbaz postgres:15.1-alpine

I added '-p 5432:5432' and it works:
docker run -it --rm -p 5432:5432 -v pgdata:/var/lib/postgresql/data -e POSTGRES_PASSWORD=foobarbaz postgres:15.1-alpine

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions