colima
colima copied to clipboard
No easy way to configure Colima to use the default Docker socket
Description
On my work mac I was trying Colima, and had to remove my old Docker Desktop socket and symlink Colima's socket - the issue & fix are documented here. My docker socket clash was also from testcontainers.
On my personal mac I was trying act
to run GitHub Actions locally, and got
ERRO[0000] failed to obtain container engine info: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
...
Error: Error occurred running finally: Error occurred running finally: failed to list containers: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? (original error: <nil>) (original error: unable to determine if image already exists for image 'ghcr.io/catthehacker/ubuntu:act-latest' (): Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?)
So I'm 2 for 2 on needing to delete the old socket and symlink Colima's. It seems very common for tools to point to that socket file.
My feature request is that it'd be great if Colima would either 1. just make it work on installation, or prompt and suggest to let it do the fix for you. Actually, is it even worth asking?
If we can remove this snagging point, it'd make the early user experience a lot smoother. The project descripition is after all:
Container runtimes on macOS (and Linux) with minimal setup
I've had no other issues/requests so far - it's been working great for a few days!
I can understand your frustration. While it may be your experience, many tools are indeed catching up and utilising docker context instead.
Another advantage of this approach is the ability to try out Colima without breaking your current workflow.
But I do agree that we can provide an easier way for Colima to use the default docker socket.
Tried using act
again and the linked /var/run/docker.sock
had disappeared. I don't think it was something I did - do socket files ever get cleaned up?
If you are using any application that mounts the socket, it is possible. Unix sockets get deleted first before being re-created and mounted for socket connection.
If you are using any application that mounts the socket, it is possible. Unix sockets get deleted first before being re-created and mounted for socket connection.
I see, thanks. To increase ease of use, would the solution be to add a file watcher for the socket file? It seems a bit far away from the core engine and stuff, but could be useful for many users
I worked around a similar situation by exporting DOCKER_HOST=$HOME/.colima/docker.sock
.
It'd be nice if colima status
had subcommands or flags so that I could do something like export DOCKER_HOST=$(colima status socket)
.
@abiosoft Would it be possible to get Colima to automatically symlink /var/run/docker.sock
to $HOME/.colima/default/docker.sock
? Or at least warn if it points somewhere else? That would help some hard-to-debug scenarios I've helped colleagues resolve lately.
@henrik242 it's on the roadmap.
Something similar to colima nerdctl install
, maybe colima docker link-socket
.
(Is there a public roadmap?)
(Is there a public roadmap?)
At the moment, no.
(If you make one you can just link to it for more authoritative responses to questions like this; you could either use wiki or of course a markdown file in the repo.) And of course, thanks for all your work on this project!
Edit: Alternately, just answer questions like this with "I'm planning on it but don't know when it will be added" :)