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 committed 2016-01-02 18:21:23 +01:00
1 parent 2b1929fc33
commit 6c7d34a773
1 file changed
+1 -1
+1 -1
View File
@@ -141,7 +141,7 @@ case "$1" in
ipaddr=127.0.0.1 ipaddr=127.0.0.1
else else
id=$(docker run -d -e PORT=$port $DOCKER_ARGS $IMAGE $START_CMD) 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 fi
else else
id=$(docker run -d $DOCKER_ARGS $IMAGE $START_CMD) id=$(docker run -d $DOCKER_ARGS $IMAGE $START_CMD)