Skip to content

Conversation

@yulexun
Copy link

@yulexun yulexun commented Oct 17, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant