Download mirror error Couldn't connect: SOCKS protocol error in minikube

Keywords: Docker ssh JSON sudo

Problem description

The agent environment variable used to start minikube creates a minikube virtual machine, but errors occur when downloading or querying mirrors, such as the following two commands reporting a similar error: "Couldn't connect: SOCKS protocol error"

# Execute outside the minikube virtual machine
$ kubectl run hello-minikube --port=8080

$ minikube ssh 
# Execution in minikube virtual machine
$ docker search echoserver
Error response from daemon: Get Couldn't connect: SOCKS protocol error

Problem reason

Go into the minikube virtual machine and use docker info to see the configuration of docker

$ minikube ssh 

$ docker info
Containers: 21
 Running: 21
 Paused: 0
 Stopped: 0
Images: 10
Server Version: 18.09.8
Storage Driver: overlay2
 Backing Filesystem: extfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
 Volume: local
 Network: bridge host macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 894b81a4b802e4eb2a91d1ce216b8817763c29fb
runc version: N/A
init version: N/A (expected: )
Security Options:
  Profile: default
Kernel Version: 4.15.0
Operating System: Buildroot 2018.05.3
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 1.897GiB
Name: minikube
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
HTTP Proxy: http://<host>:<port>
HTTPS Proxy: http://<host>:<port>
No Proxy:
Experimental: false
Insecure Registries:
Live Restore Enabled: false
Product License: Community Engine

It contains the following three lines, which are the agents you used when you started minikube, which were written into the docker configuration file by minikube.

HTTP Proxy: http://<host>:<port>
HTTPS Proxy: http://<host>:<port>
No Proxy:


Log in to the virtual machine using the "minikube ssh" command, and then modify the Docker configuration file / usr / lib / system / system / docker. service, which is the path of the Docker configuration file on CentOS 7. x, commenting out the three lines above.


Restart service

$ sudo systemctl daemon-reload
$ sudo systemctl restart docker.service

Then re-query or retrieve the mirror to solve the problem.

Posted by MadDogSh on Thu, 03 Oct 2019 03:08:55 -0700