How do I detect the IP of a docker container running on Windows host with WSL?
I can see docker container is running:
juergen@DESKTOP4WIN10:~$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
74f26c50a729 jschulze71/apache2 "sh -c '. /etc/apach…" 24 seconds ago Up 23 seconds 0.0.0.0:8080->80/tcp elegant_jepsen
3
Answers
Open Windows command line and use ipconfig
Find Ethernet-Adapter vEthernet (WSL) (Or similar) there you will see IP4 and IP6.
Screenshot is from a german Windows but I am sure other version look pretty much the same.
You can try launching "hostname -I" command inside the running container.
For example:
You can get the IP address of containers from this command: