A bridge network has been created in docker using the following:
docker network create blognetwork
And a container has been created in that network with the following:
docker run --name=blogdb --network=blognetwork -p 3306:3306 -e --bind-address=0.0.0.0 -e=MYSQL_ROOT_PASSWORD=mypassword -detach mysql
How do I access the ip address of the new container, within the "blognetwork", from a windows host?
How do I get the ip address of the form X.X.X.X, on its own? I know I can use the following to get a large json output with this data in it:
docker network inspect blognetwork
You can get directly the ip by using docker inspect and a proper format:
docker inspect containerId --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}'
More info in the Docker documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With