Why does Colima failed to find Docker daemon

49.9k Views Asked by At

I was using Docker Desktop on my Mac for a long time. Currently Docker desktop causing a huge issues related to starting up. Everytime it needs some tweak to run or uninstall and install it again, that takes several hours to fix every time I start working.

So I started using other Docker Desktop alternative for mac that is Colima (Container on Linux on Mac) installed with the help of the Git link.

And I am using Docker client for Docker runtime by installing it using: brew install docker and I have logged in using docker login via terminal.

The important note here is that all the above configuration works well with Docker Desktop but after uninstalling everything related to docker and start using Colima.

While I run docker info I got the following message:

$ docker info
Client:
 Context:    default
 Debug Mode: false

Server:
ERROR: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
errors pretty printing info

Here are few other information that might need:

$ colima version
colima version 0.4.2
git commit: f112f336d05926d62eb6134ee3d00f206560493b

runtime: docker
arch: x86_64
client: v20.10.17
server: v20.10.11

kubernetes
Client Version: v1.24.1
Kustomize Version: v4.5.4
Server Version: v1.23.6+k3s1

Operating System: macOS Monterey Version: 12.3.1 (21E258)

Any help would be highly appreciated.

6

There are 6 best solutions below

0
On

beware, starting with colima 0.4 the socket path is:

$HOME/.colima/default/docker.sock

(https://github.com/abiosoft/colima/blob/main/docs/FAQ.md#v040-or-newer)

0
On

Simple solution would be:

  1. Add export DOCKER_HOST at end of your ~/.bashrc: export DOCKER_HOST="unix:///Users/dmitry/.colima/default/docker.sock"
  2. Source your rc file: source ~/.bashrc
  3. Restart colima: calima stop and colima start

As for me that solution works fine.

2
On

I have same problem, because i start colima before install docker, i run

$ colima delete
$ colima start

terminal print:

INFO[0000] starting colima                             
INFO[0000] runtime: docker

and colima docker worked!

0
On

Best is to add docker-host in .zshrc file

export DOCKER_HOST="unix://$HOME/.colima/docker.sock"

Note that in case you uninstall colima, then again install docker-desktop, then just comment above line of .zshrc file

5
On

After posting the question on StackOverflow I was non stop searching for a solution. Finally it took a day to fixed it (for me). While searching on google I have found a solution in this link.

Basically Colima usage $HOME/.colima/docker.sock, so first I checked if there is anything in the ~/.colima by running ls -la ~/.colima and I have found that docker.sock is there.

So I set up the DOCKER_HOST by running the following command:

$ export DOCKER_HOST="unix://$HOME/.colima/docker.sock"

and then run:

$ docker info

Now it shows everything related to Docker Server :)

Client:
 Context:    default
 Debug Mode: false

Server:
 Containers: 29
  Running: 19
  Paused: 0
  Stopped: 10
 Images: 19
 Server Version: 20.10.11
 .....
0
On

I haved the same issue and the error persisted after colima delete, then i use colima start --edit and change the runtime to docker

# Container runtime to be used (docker, containerd).
# Default: docker
runtime: docker