You should consider also the new sintax to retrieve the public IP.
$ docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $INSTANCE_ID
I use Docker version 17.12.0-ce and the old method is not working anymore, returns null
$ docker inspect --format '{{ .NetworkSettings.IPAddress }}' $INSTANCE_ID
Please check Docker Docs
You should consider also the new sintax to retrieve the public IP.
$ docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $INSTANCE_IDI use Docker version 17.12.0-ce and the old method is not working anymore, returns null
$ docker inspect --format '{{ .NetworkSettings.IPAddress }}' $INSTANCE_IDPlease check Docker Docs