When you first start using Docker, you will inevitably get flustered when you encounter unusual problems. It’s okay, that’s how learning works, constantly finding ways to solve problems in the face of difficulties, the key is to persist, come on! Here it comes, here comes the problem, don’t panic, look below: We opened Docker normally and executed the command, but an error during connect exception was reported. The following is an explanation of the corresponding exception error: No connection could be made because the target machine actively refused it. Now we know where the problem is. Our Docker image runs on VirtualBox (Win10 Home Edition), so the target machine here is VirtualBox and there is a problem with the connection. Two solutions: Open VirtualBox and restart the default service. And then it works. You don’t have to open VirtualBox. You can also restart the default by executing the command. Execute the command in docker:
result: The entry and exit execution commands can be executed smoothly. The problem has been solved. It is not difficult. I will remember it next time I encounter it. Additional knowledge: After installing Docker on Windows, the program started in the Docker container cannot be accessed through the external ip:port method Recently, I have been using containers to start a development project. However, I found that after starting it in a container under the Linux system using the same image, I can access it through the Linux IP:port (mapped port) and the container IP:port, but I cannot access it under Windows. There are two solutions Access directly on the Windows host You can access it using LinuxIP:port Installing Docker in Windows actually starts a Linux virtual machine and runs Docker in Linux, so it cannot be accessed directly using the window IP: port method. Here you should use the virtual machine's IP: mapped port method to access it. Query the IP address command of the Windows Docker startup machine:
Usually 192.168.99.100 At this time, you can successfully access it using 192.168.99.100:port Need to access on other machines connected to Windows When we need to access it on other machines connected to Windows, we need to use the windowsIP:port method, and then we need to configure the virtual machine. Open VM VirtualBox, 1. Select default, right-click settings -> 2. Select "Network" in the left menu -> 3. Click "Advanced" in Network Card 1 to expand -> 4. Click Port Forwarding to open the port forwarding configuration interface Configure in the port forwarding rule interface, click the "+" button on the right to add a port forwarding rule, fill in the name, host port, subsystem port, click OK below to save. After saving, you can use windowsIP: host port to access it. (The host port corresponds to the Windows system port; the subsystem port is the port of the Linux virtual machine, that is, the port mapped to the container. For example, when starting a container in Docker, map the container's port 8181 to 8186, that is, -p 8186:8181, then fill in 8186 for the subsystem port here) The above article on solving the error during connect exception in Docker 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:
|
<<: Details on overriding prototype methods in JavaScript instance objects
>>: Summary of MySQL date and time functions (MySQL 5.X)
1. Modify my.cnf #The overall effect is that both...
Usage: date [options]... [+format] or: date [-u|-...
When logging in to the stress test, many differen...
Table of contents 1. Brief Overview 2. Detailed e...
Table of contents vite function Use Environment B...
A root routing component (the root routing compon...
Web Services are concerned with application-to-ap...
This article shares the specific code of js to im...
In MySQL operation and maintenance, a R&D col...
<br />Tips for making web table frames. ----...
This article shares the specific code of JS+AJAX ...
Table of contents MySQL multi-version concurrency...
Conclusion: In a multithreaded environment, if on...
Table of contents 【Common commands】 [Summary of c...
Recently, the client of a project insisted on hav...