Executing docker search redis prompts the following error: Error response from daemon: Get https://index.docker.io/v1/search?q=redis&n=25: dial tcp: lookup index.docker.io on 10.0.2.3:53: server misbehaving . As shown below
Solution:
1. SSH remote to the default virtual machine.
Enter the command: docker-machine ssh default
where default is the name of the virtual core machine, start- >all programs->Oracle VM VirtualBox->Oracle VM VirtualBox
2. Set the /etc/resolv.conf configuration file to
view the /etc/resolv.conf configuration File content:
The docker search redis routing error occurred due to the incorrect DNS IP. For the specific DNS value, refer to the DNS of the network on your own physical computer. As shown in the figure below:
Note that because the complete vi or vim operation command cannot be executed on the virtual machine to modify this configuration file, copy the command content
sudo tee /etc/resolv.conf <<-'EOF'
nameserver 192.168.1.1
nameserver 192.168.0.1
EOF
Press Enter, the operation result is as follows, the modification is complete.
Enter: exit to exit the virtual machine.
Re-enter: docker search redis can operate normally