Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ sudo docker run -d --name test-postgresql -p 5432 -e POSTGRES_PASSWORD=postgres postgres
- Starting test-postgresql at localhost:5432
- $ sudo docker ps
- CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
- 6428cee63305 postgres:latest "/docker-entrypoint. 1 seconds ago Up Less than a second 0.0.0.0:5432->5432/tcp test-postgresql
- $ netstat -na | grep 5432
- tcp6 0 0 :::5432 :::* LISTEN
- $ docker exec -t test-postgresql psql -h localhost -U postgres -p 5432 -c 'show data_directory'
- psql: could not connect to server: Connection refused
- Is the server running on host "localhost" (::1) and accepting
- TCP/IP connections on port 5432?
- could not connect to server: Connection refused
- Is the server running on host "localhost" (127.0.0.1) and accepting
- TCP/IP connections on port 5432?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement