Skip to content

Why ctop Fails on Latest Docker Version: Understanding Socket Changes in macOS Ventura with docker v23.0.5 or Later

I’m a big fan of ctop, the powerful command-line container manager for Docker containers from bcicen/ctop. However, after upgrading my Mac OSX Ventura (13.4) to run on docker v23.0.5 and attempting ctop usage, I encountered an error:

Get "http://unix.sock/info": dial unix /var/run/docker.sock: connect: no such file or directory

This issue arises because the latest Docker versions have changed socket location from /var/run/docker.sock to Users/$USER/.docker/volumes/default-directory/ where $USER is your system username, and this affects tools like ctop that expect a certain default pathway for connection with docker daemon via Unix sockets:

Connecting Error

I discovered the Docker socket at Users/$USER/.docker/run ($SYSTEM_UID) in my case, and tried setting it as an environment variable with this command:

export DOCKER_HOST=/Users/sethlutske/.docker/run/docker.sock

However, executing ctop resulted into another error indicating the use of a non-supported protocol scheme (tcp://...). The underlying reason seems that Docker Desktop versions 4.18 and above no longer create /var/run/docker.sock. This is explained in official docker docs where they suggest:

If you want to have the default socket back, open your Docker Desktop application settings and select ‘Allow this daemon to access raw sockets’ under Advanced options (Settings -> General). Alternatively, some users prefer setting a different location using DOCKER_HOST environment variable.

Here are two potential ways around the issue:

  1. Open Docker Desktop application settings on Ventura and enable ‘Allow this daemon to access raw sockets’. This way will recreate /var/run/docker.sock. Then, you can use ctop:
export DOCKER_HOST=/var/run/docker.sock
cothode -d
  1. If the above doesn’t work due to permission issues (noticeable on macOS), setting a different Docker socket using environment variable might help:
export DOCKER_HOST="/Users/$USER/.DockerDesktopService/docker.rawsocket" # assuming your username is sethlutske and you have installed docker via desktop service, replace accordingly with appropriate pathway on Windows or Linux systems where necessary adjustments are made for the Docker socket location based version of system

Remember to include this environment variable at startup using .zshrc,.bashrc files respectively. This will effectively solve your issue and help ctop connect back with latest versions of docker without changing default paths or permissions on OSX Ventura:


Previous Post
How to Wait for GitLab Downstream Pipelines Before
Next Post
Understanding Helm Chart Version Constraints Ingr