You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have built the docker image, ran it, and connect to it to verify it works. I can use psql in the instance shell and create database, etc. That all seems to work fine.
What I cant do is connect from my Mac host to the running container DB. I have used the IP from docker inspect, the -p 5432:5432 is in my run command, etc. In fact, I cant even ping the container ip listed in inspect.
Ultimately I want to a) connect via my host to the DB and b) have a separate container connect to the DB container.
I am using the latest native docker on Mac now, no longer boot2docker. Is there something special needed to make this work?
The text was updated successfully, but these errors were encountered:
I think some of the parameters changed somewhere along the way docker run --name NAME --expose 5432 -p 5432:5432 -e POSTGRES_USER=dbuser -e POSTGRES_DB=dbname -e POSTGRES_PASSWORD=password -d postgres
This worked for me - note that I used a different port number because I have postgres running locally on my Mac: docker run -it --rm -p 5433:5432 -e POSTGRES_PASSWORD=12345 -e POSTGRES_USER=bob postgres:latest
psql -p 5433 -h localhost -U postgres
Also, problems can crop up for other reasons such a volume hanging around - see e.g. #203 (comment)
Hi all,
I have built the docker image, ran it, and connect to it to verify it works. I can use psql in the instance shell and create database, etc. That all seems to work fine.
What I cant do is connect from my Mac host to the running container DB. I have used the IP from docker inspect, the -p 5432:5432 is in my run command, etc. In fact, I cant even ping the container ip listed in inspect.
Ultimately I want to a) connect via my host to the DB and b) have a separate container connect to the DB container.
I am using the latest native docker on Mac now, no longer boot2docker. Is there something special needed to make this work?
The text was updated successfully, but these errors were encountered: