1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Use inspect format to get IP address for psql example

This commit is contained in:
Dustin Sallings 2013-11-29 16:12:10 -08:00
parent 9837ad8e9b
commit 1d503be466

View file

@ -127,7 +127,7 @@ on the machine. For ubuntu, use something like
.. code-block:: bash
CONTAINER_IP=$(sudo docker inspect $CONTAINER | grep IPAddress | awk '{ print $2 }' | tr -d ',"')
CONTAINER_IP=$(sudo docker inspect -format='{{.NetworkSettings.IPAddress}}' $CONTAINER)
psql -h $CONTAINER_IP -p 5432 -d docker -U docker -W
As before, create roles or databases if needed.