bcicen / ctop

Top-like interface for container metrics
https://ctop.sh
MIT License
15.6k stars 528 forks source link

Is it possible to use ctop with Colima on macOS? #323

Closed fosron closed 1 year ago

fosron commented 1 year ago

I'm trying to use Colima and Docker on macOS with ctop and i'm getting this

  │                                                                                                                                                                                                                                              │
  │  [15:12:01 EET] Get "http://unix.sock/info": dial unix /var/run/docker.sock: connect: no such file or directory                                                                                                                              │
  │                                                                                                                                                                                                                                              │
  │  [15:12:01 EET] attempting to reconnect...

I found the socket URL using

colima status
...
INFO[0000] socket: unix:///Users/***/.colima/default/docker.sock

But trying it using ctop -connector does not seem to work.

panic: invalid connector type "unix:///Users/***/.colima/default/docker.sock" [recovered]
    panic: invalid connector type "unix:///Users/***/.colima/default/docker.sock"

goroutine 1 [running]:
main.panicExit()
    /private/tmp/ctop-20221119-4843-3lgt7h/main.go:137 +0x4d
panic({0x143e0e0, 0xc000067e30})
    /usr/local/Cellar/go/1.19.3/libexec/src/runtime/panic.go:884 +0x212
main.main()
    /private/tmp/ctop-20221119-4843-3lgt7h/main.go:102 +0x61e
fosron commented 1 year ago

Ok found a solution:

export DOCKER_HOST="unix://$HOME/.colima/docker.sock"
dimaqq commented 11 months ago

Adding a note for future generations:

colima can be ran with either containerd or docker runtime. (see ~/.colima/default/colima.yaml; if you have to use colima nerdctl then it's containerd runtime).

the solution above works for docker runtime, but obv., not for containerd runtime.