docker inspect --format doesn't work in Windows #433
Comments
Wondering; does it work if you use double quotes? |
Doesn't work with double quotes as well. |
alright - can you open an issue in the https://github.com/docker/docker/issues issue-tracker? This sounds like an issue in the Docker Engine (or a combination of Docker Engine and the environment the CLI runs in) |
it could be an issue in how Go parses the format in Windows. The engine doesn't do anything different to parse the format whether it's linux or windows. |
@thaJeztah Same problem but when I change |
[Good old necro posting] Thank you @Gmanweb . The following command does indeed do the job still in 2020:
|
Still, there doesn't seem to be a way to ping a Linux Docker containing from a host Windows machine. Anyone found a way to do that? |
The container's IP address is an internal IP address; to ping/reach the container, use port mapping to publish its port(s); |
Already tried this solution, but it didn't work. I'm running a Flask app within my Docker container at port 5000 and I would like to expose it at that same port, so that it would be reachable from my local Windows 10 machine. The thing is that I can't even ping my container's IP address in the first place. |
If it's a linux container, the container runs inside a lightweight VM, and that IP address isn't accessible from your host. |
Finally got it working with this hint, thank you so much!! In the Dockerfile, I specified the following command to start the flask app:
And then, I ran the container with the following command:
Finally, I was able to access my webapp in the browser! |
On Windows 10 |
As suggested above, it worked after replacing single quotes with double quotes: docker inspect --format="{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}" |
Hello I'm trying to use
docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}'
from docker inspect examples. But it's giving me these error:Template parsing error: template: :1: unexpected unclosed action in range
I'm using the docker quickstart terminal.
I created it here because that same command works in Linux machines.
The text was updated successfully, but these errors were encountered: