docker / for-mac

Bug reports for Docker Desktop for Mac
https://www.docker.com/products/docker#/mac
2.44k stars 119 forks source link

Can not find shim sock from kubernetes installation on MacOS #7211

Open Jeffwan opened 9 months ago

Jeffwan commented 9 months ago

Description

I am installing https://openkruise.io/ on MacOS kubernetes and face a problem.

k logs -f kruise-daemon-6cphj -n kruise-system
I0304 06:16:21.922293       1 feature_gate.go:245] feature gates: &{map[PodProbeMarkerGate:true]}
I0304 06:16:21.923130       1 daemon.go:101] Starting daemon on docker-desktop ...
I0304 06:16:22.021987       1 request.go:622] Waited for 90.370904ms due to client-side throttling, not priority and fairness, request: GET:https://10.96.0.1:443/apis/policy.kruise.io/v1alpha1?timeout=32s
E0304 06:16:22.323603       1 factory.go:208] /hostvarrun/docker.sock exists, but not found /hostvarrun/dockershim.sock
F0304 06:16:22.323662       1 main.go:69] Failed to new daemon: failed to new runtime factory: not found container runtime sock

/var/run/docker.sock is there but there's no other shim layer. I assume it uses cri-docker but I can not find it. I can not find kubelet process as well. Can I know where to check the settings?

Reproduce

just install the kruise app. nothing special

Expected behavior

No response

docker version

Client:
 Cloud integration: v1.0.35+desktop.10
 Version:           25.0.3
 API version:       1.44
 Go version:        go1.21.6
 Git commit:        4debf41
 Built:             Tue Feb  6 21:13:26 2024
 OS/Arch:           darwin/amd64
 Context:           desktop-linux

Server: Docker Desktop 4.27.2 (137060)
 Engine:
  Version:          25.0.3
  API version:      1.44 (minimum version 1.24)
  Go version:       go1.21.6
  Git commit:       f417435
  Built:            Tue Feb  6 21:14:25 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.28
  GitCommit:        ae07eda36dd25f8a1b98dfbf587313b99c0190bb
 runc:
  Version:          1.1.12
  GitCommit:        v1.1.12-0-g51d5e94
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

docker info

Client:
 Version:    25.0.3
 Context:    desktop-linux
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.12.1-desktop.4
    Path:     /Users/bb/.docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.24.5-desktop.1
    Path:     /Users/bb/.docker/cli-plugins/docker-compose
  debug: Get a shell into any image or container. (Docker Inc.)
    Version:  0.0.24
    Path:     /Users/bb/.docker/cli-plugins/docker-debug
  dev: Docker Dev Environments (Docker Inc.)
    Version:  v0.1.0
    Path:     /Users/bb/.docker/cli-plugins/docker-dev
  extension: Manages Docker extensions (Docker Inc.)
    Version:  v0.2.21
    Path:     /Users/bb/.docker/cli-plugins/docker-extension
  feedback: Provide feedback, right in your terminal! (Docker Inc.)
    Version:  v1.0.4
    Path:     /Users/bb/.docker/cli-plugins/docker-feedback
  init: Creates Docker-related starter files for your project (Docker Inc.)
    Version:  v1.0.0
    Path:     /Users/bb/.docker/cli-plugins/docker-init
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc.)
    Version:  0.6.0
    Path:     /Users/bb/.docker/cli-plugins/docker-sbom
  scout: Docker Scout (Docker Inc.)
    Version:  v1.4.1
    Path:     /Users/bb/.docker/cli-plugins/docker-scout
WARNING: Plugin "/Users/bb/.docker/cli-plugins/docker-scan" is not valid: failed to fetch metadata: fork/exec /Users/bb/.docker/cli-plugins/docker-scan: no such file or directory

Server:
 Containers: 83
  Running: 79
  Paused: 0
  Stopped: 4
 Images: 24
 Server Version: 25.0.3
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: ae07eda36dd25f8a1b98dfbf587313b99c0190bb
 runc version: v1.1.12-0-g51d5e94
 init version: de40ad0
 Security Options:
  seccomp
   Profile: unconfined
  cgroupns
 Kernel Version: 6.6.12-linuxkit
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 4
 Total Memory: 7.757GiB
 Name: docker-desktop
 ID: bd722090-75e2-4308-bf8f-9b26ace25927
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 No Proxy: hubproxy.docker.internal
 Experimental: false
 Insecure Registries:
  hubproxy.docker.internal:5555
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: daemon is not using the default seccomp profile

Diagnostics ID

867FDD0B-D0BD-49BF-B422-4A364B709818/20240304084302

Additional Info

No response

tiankai-yuan commented 8 months ago

安装的时候,带上 --set daemon.socketLocation=/var/run/,daemon.socketFile=cri-dockerd.sock 因为源码里面:CRISocketFileName = flag.String("socket-file", "", "The name of CRI socket file, and it should be in the mounted /hostvarrun directory.") 还有就是: // docker { , err1 := os.Stat(fmt.Sprintf("%s/docker.sock", varRunPath)) , err2 := os.Stat(fmt.Sprintf("%s/dockershim.sock", varRunPath)) if err1 == nil && err2 == nil { cfgs = append(cfgs, runtimeConfig{ runtimeType: ContainerRuntimeDocker, runtimeURI: fmt.Sprintf("unix://%s/docker.sock", varRunPath), runtimeRemoteURI: fmt.Sprintf("unix://%s/dockershim.sock", varRunPath), }) } else if err1 == nil && err2 != nil { klog.Errorf("%s/docker.sock exists, but not found %s/dockershim.sock", varRunPath, varRunPath) } else if err1 != nil && err2 == nil { klog.Errorf("%s/dockershim.sock exists, but not found %s/docker.sock", varRunPath, varRunPath) } } 用到的是runtimeURI,而不是runtimeRemoteURI,所以规避这个错误就行