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.
This commit is contained in:
Adrian Perez
2016-01-02 18:21:23 +01:00
parent 2b1929fc33
commit 6c7d34a773

2
dokku
View File

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