mirror of
https://github.com/nektos/act.git
synced 2026-04-26 01:15:51 +03:00
[GH-ISSUE #1051] Issue: cannot connect to Docker daemon #612
Labels
No labels
area/action
area/cli
area/docs
area/image
area/runner
area/workflow
backlog
confirmed/not-planned
kind/bug
kind/discussion
kind/external
kind/feature-request
kind/question
meta/duplicate
meta/invalid
meta/need-more-info
meta/resolved
meta/wontfix
meta/workaround
needs-work
pull-request
review/not-planned
size/M
size/XL
size/XXL
stale
stale-exempt
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/act#612
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @adzimzf on GitHub (Mar 16, 2022).
Original GitHub issue: https://github.com/nektos/act/issues/1051
System information
act: -actversion: act version 0.2.25Expected behaviour
the act can run
Actual behaviour
the act always ask regarding the docker is running.
Is the docker daemon running?but when I pull the image manually it works
Workflow and/or repository
Steps to reproduce
act pull_request --container-architecture linux/amd64 -P runner-1=nektos/act-environments-ubuntu:18.04
actoutputLog
@catthehacker commented on GitHub (Mar 16, 2022):
Do you have
DOCKER_HOSTenvironment variable set? You can't connect to Docker on macOS via unix socket because it's running in virtual machine.@adzimzf commented on GitHub (Mar 16, 2022):
I check it, there's no env variable for
DOCKER_HOST@catthehacker commented on GitHub (Mar 16, 2022):
It seems Docker for Mac supports
unix:///var/run/docker.sockso I have no idea what's wrong@catthehacker commented on GitHub (Mar 16, 2022):
You could check if
/var/runactually containsdocker.sock@adzimzf commented on GitHub (Mar 17, 2022):
I try to search there's no
docker.sockunder/var/runis this due to I use
colimaas the docker server?@catthehacker commented on GitHub (Mar 17, 2022):
Probably, I don't have a mac so I can't check how it works. It's better if you ask in https://github.com/abiosoft/colima how to get
/var/run/docker.sockunix socket or some other way to connect to it.@aldafu commented on GitHub (Mar 17, 2022):
colimauses$HOME/.colima/docker.sockRegardless, it seems that the option
--container-daemon-socketmight not work?I tried
--container-daemon-socket unix://$HOME/.colima/docker.sock--container-daemon-socket="unix://$HOME/.colima/docker.sock"--container-daemon-socket $HOME/.colima/docker.sock--container-daemon-socket="$HOME/.colima/docker.sock"but still got
Cannot connect to the Docker daemon at unix:///var/run/docker.sock.setting
DOCKER_HOST="unix://$HOME/.colima/docker.sock"did work however.@catthehacker commented on GitHub (Mar 17, 2022):
--container-daemon-socketis for path to socket that will be mounted into containersWe follow Docker connect flow by using
DOCKER_HOSTto find Docker Engine API compatible daemon (dockerd,podman, etc.)@portovep commented on GitHub (Mar 19, 2022):
Thanks @catthehacker. I am using Colima and that worked for me.
@adzimzf commented on GitHub (Mar 21, 2022):
thanks, that works for me too.
so the problem is why the
DOCKER_HOSTis not set by default, am I correct?@catthehacker commented on GitHub (Mar 21, 2022):
Yes
@roseline124 commented on GitHub (Oct 12, 2022):
This saved my time. Thank you!
@shuuji3 commented on GitHub (Dec 7, 2022):
Colima v0.4.0+ uses
$HOME/.colima/default/docker.sockas a new socket location. You can check the socket path by runningcolima status(ref. colima/FAQ.md at main · abiosoft/colima · GitHub):Another option to set the correct socket path programatically is to get it via
docker contextoutput. Thedocker context lsprintouts the list of docker contexts:Then, we can get the correct path of
colimacontext like:So we can export
DOCKER_HOSTwith this command:@zoedsoupe commented on GitHub (Apr 28, 2023):
This did the trick for mac users that use Docker desktop!
@cyberw commented on GitHub (Sep 24, 2023):
shuuji3's suggestion with a slight modification helps for rancher desktop as well:
export DOCKER_HOST=$(docker context inspect | jq -r '.[0].Endpoints.docker.Host')@nabilfreeman commented on GitHub (Nov 13, 2023):
For me, running Docker Desktop on MacOS Ventura ARM, my socket path was:
unix:///Users/myusername/.docker/run/docker.sockTo be clear, the
/Users/myusernamedirectory is equivalent to~.So I think this fix is necessary for regular Docker users as well.
@ovnicraft commented on GitHub (Dec 5, 2023):
it could solved executing
act, e.g withpush:DOCKER_HOST=unix:///Users/<USER>/.colima/default/docker.sock act push --container-architecture linux/arm64@mahiki commented on GitHub (Dec 12, 2023):
for what its worth on macos with Rancher Desktop I was able to eliminate the error:
with