From 6c7d34a77354dc68e0d940336ec80cf0e2b15876 Mon Sep 17 00:00:00 2001 From: Adrian Perez Date: Sat, 2 Jan 2016 18:21:23 +0100 Subject: [PATCH] fix: use new template for extracting IP I was running into issues with the IP addresses, and it seems that it's using an incorrect/outdated syntax for retrieving the container's IP Address. In multi-host networking `NetworkSettings.IPAddress` is empty. The docker documentation at https://docs.docker.com/engine/reference/commandline/inspect/ uses a different syntax which I've tested to work both on multi-host and standard bridge networking. If you're interested in the other issues and the work/hacks I've been doing related to #1795, let me know. In the meantime, I think this fix is needed. --- dokku | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dokku b/dokku index ada80a2e5..bb162918b 100755 --- a/dokku +++ b/dokku @@ -141,7 +141,7 @@ case "$1" in ipaddr=127.0.0.1 else id=$(docker run -d -e PORT=$port $DOCKER_ARGS $IMAGE $START_CMD) - ipaddr=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' $id) + ipaddr=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $id) fi else id=$(docker run -d $DOCKER_ARGS $IMAGE $START_CMD)