Skip to content

Add a tip to the Docker page for connecting from the host via the -p option - #1061

Open
pcimring wants to merge 2 commits into
percona:18from
pcimring:docker-host-app-port
Open

pcimring wants to merge 2 commits into
percona:18from
pcimring:docker-host-app-port

Conversation

@pcimring

Copy link
Copy Markdown

Summary

  • Add a tip explaining how an application on the host machine itself can connect to PostgreSQL in Docker. Currently the section covers only applications in another Docker container.

Related: #1060 (same page, independent change).

Verification

  • Built the site locally with mkdocs build.
  • Ran the command as written with percona/percona-distribution-postgresql:18.6 on arm64 and connected from the host to localhost:5432.

🤖 Generated with Claude Code

…option

Show -p 5432:5432 for applications that run on the host machine itself.
The section covers only applications in another container.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ImTheKai

Copy link
Copy Markdown
Collaborator

Hi, two nit picks on that:

  1. -p 5432:5432 makes the port reachable from the whole network, and with POSTGRES_PASSWORD=secret that's not a great default to copy and paste. Maybe use -p 127.0.0.1:5432:5432, or add a short note about it?

  2. If PostgreSQL is already running on the host, port 5432 will be taken. A quick "for example, -p 5433:5432 if 5432 is in use" would help there.

@ImTheKai ImTheKai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please address my comments before we can merge it

Addresses review: the example no longer exposes PostgreSQL to the network,
and the tip shows using another host port when 5432 is taken.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pcimring

Copy link
Copy Markdown
Author

Thanks for the feedback. I've updated the text to address both points. Ready for another look.

@pcimring
pcimring requested a review from ImTheKai November 25, 2026 15:08

This branch has not been deployed

No deployments
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.

2 participants