瀏覽代碼

Use inspect format to get IP address for psql example

Dustin Sallings 11 年之前
父節點
當前提交
1d503be466
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      docs/sources/examples/postgresql_service.rst

+ 1 - 1
docs/sources/examples/postgresql_service.rst

@@ -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.