Advertisement
Guest User

Untitled

a guest
May 25th, 2015
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. $ sudo docker run -d --name test-postgresql -p 5432 -e POSTGRES_PASSWORD=postgres postgres
  2.  
  3. Starting test-postgresql at localhost:5432
  4.  
  5. $ sudo docker ps
  6.  
  7. CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
  8. 6428cee63305 postgres:latest "/docker-entrypoint. 1 seconds ago Up Less than a second 0.0.0.0:5432->5432/tcp test-postgresql
  9.  
  10. $ netstat -na | grep 5432
  11.  
  12. tcp6 0 0 :::5432 :::* LISTEN
  13.  
  14. $ docker exec -t test-postgresql psql -h localhost -U postgres -p 5432 -c 'show data_directory'
  15.  
  16. psql: could not connect to server: Connection refused
  17. Is the server running on host "localhost" (::1) and accepting
  18. TCP/IP connections on port 5432?
  19. could not connect to server: Connection refused
  20. Is the server running on host "localhost" (127.0.0.1) and accepting
  21. TCP/IP connections on port 5432?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement