How to communicate between WIN10 system and Docker internal container IP

How to communicate between WIN10 system and Docker internal container IP

1. After installing the Windows version of Docker, we start the Docker Quickstart Terminal and we will get an IP address. Mine is:

192.168.99.100

2. Start a mysql image and get the IP of this image:

At the beginning, the network is not accessible from the local machine directly to 172.17.0.2, but our local machine can reach 192.168.99.100, and 172.17.0.2 to 192.168.99.100 is also accessible. We can configure a route from the local machine to 172.17.0.2 via 192.168.99.100:

route add -p 172.17.0.0 mask 255.255.0.0 192.168.99.100

Check the route and you will see that there is a route to the 172.17.0.0 network segment.

At this time, we can ping 172.17.0.2 from our local machine. Then we use navicat to connect to the mysql container in Docker:

Additional knowledge: Bugs that occur during the use of docker

This record is about some bugs that occurred when using Docker and how I solved them. The bugs encountered when using Docker will be supplemented later.

Bug 1, verify whether nvidia-docker is installed successfully (enter the command sudo nvidia-docker run --rm nvidia/cuda nvidia-smi, the following error is generated)

lab712@lab712:~$ sudo nvidia-docker run --rm nvidia/cuda nvidia-smi

docker: Error response from daemon: OCI runtime create failed: container_linux.go:344: starting container process caused "process_linux.go:424: container init caused \"process_linux.go:407: running prestart hook 1 caused \\\"error running hook: exit status 1, stdout: , stderr: exec command: [/usr/bin/nvidia-container-cli --load-kmods configure --ldconfig=@/sbin/ldconfig.real --device=all --compute --utility --require=cuda>=10.0 brand=tesla,driver>=384,driver<385 --pid=4760 /var/lib/docker/overlay2/2b42e419162d46fad61c0a70cbb7b16c79a8878f2dab1af682dbff4813b57316/merged]\\\\nnvidia-container-cli: requirement error: unsatisfied condition: brand = tesla\\\\n\\\"\"": unknown.

Check the image files installed on your computer and find that when installing nvidia-docker, three nvidia/cuda with different tags (TAGs) were pulled, as shown in Figure 1 below. The graphics card driver is installed. Since I did not specify the nvidia/cuda tag (TAG) when using the command, the tag latest will be directly called by default.

After re-specifying the tag (TAG), enter the command: nvidia-docker run --rm nvidia/cuda:9.0-base nvidia-smi , and it will be successful. The results are shown in Figure 2.

The above article about the intercommunication method between WIN10 system and Docker internal container IP is all the content that the editor shares with you. I hope it can give you a reference. I also hope that you will support 123WORDPRESS.COM.

You may also be interested in:
  • Solution to the Docker container being unable to access the host port
  • Docker connects to a container through a port
  • Docker uses a single image to map to multiple ports
  • Perfect solution to the problem of not being able to access the port of the docker container under Windows 10

<<:  How to display only the center of the image in the img tag in HTML (three methods)

>>:  How to encapsulate axios in Vue

Recommend

VMware ESXI server virtualization cluster

Table of contents summary Environment and tool pr...

Detailed explanation of the usage of MySQL data type DECIMAL

MySQL DECIMAL data type is used to store exact nu...

How to open external network access rights for mysql

As shown below: Mainly execute authorization comm...

How to use javascript to do simple algorithms

Table of contents 1 Question 2 Methods 3 Experime...

What is Software 404 and 404 Error and what is the difference between them

First of all, what is 404 and soft 404? 404: Simpl...

5 issues you should pay attention to when making a web page

1. Color matching problem <br />A web page s...

MySQL 5.7.17 installation and use graphic tutorial

MySQL is a relational database management system ...

CSS horizontal centering and limiting the maximum width

A CSS layout and style question: how to balance h...

Problems and solutions encountered when installing mininet on Ubuntu 16.04.4LTS

Mininet Mininet is a lightweight software defined...

Briefly describe the difference between MySQL and Oracle

1. Oracle is a large database while MySQL is a sm...

How to Learn Algorithmic Complexity with JavaScript

Table of contents Overview What is Big O notation...