nektos / act

Run your GitHub Actions locally 🚀
https://nektosact.com
MIT License
53.94k stars 1.35k forks source link

act not respecting `--container-daemon-socket` argument #2314

Open bretdavi89 opened 4 months ago

bretdavi89 commented 4 months ago

Bug report info

act version:            0.2.62
GOOS:                   linux
GOARCH:                 amd64
NumCPU:                 4
Docker host:            DOCKER_HOST environment variable is not set
Sockets found:
        /var/run/docker.sock
        $XDG_RUNTIME_DIR/docker.sock
Config files:           
        /home/bretdavi/.actrc:
                -P ubuntu-latest=catthehacker/ubuntu:act-latest
                -P ubuntu-22.04=catthehacker/ubuntu:act-22.04
                -P ubuntu-20.04=catthehacker/ubuntu:act-20.04
                -P ubuntu-18.04=catthehacker/ubuntu:act-18.04
Build info:
        Go version:            go1.22.2
        Module path:           command-line-arguments
        Main version:          
        Main path:             
        Main checksum:         
        Build settings:
                -buildmode:           exe
                -compiler:            gc
                -ldflags:             -X main.version=0.2.62
                DefaultGODEBUG:       httplaxcontentlength=1,httpmuxgo121=1,tls10server=1,tlsrsakex=1,tlsunsafeekm=1
                CGO_ENABLED:          1
                CGO_CFLAGS:           
                CGO_CPPFLAGS:         
                CGO_CXXFLAGS:         
                CGO_LDFLAGS:          
                GOARCH:               amd64
                GOOS:                 linux
                GOAMD64:              v1

Error: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

Command used with act

$ act --container-daemon-socket="unix:///run/user/1000/docker.sock"
INFO[0000] Using docker host 'unix:///var/run/docker.sock', and daemon socket 'unix:///run/user/1000/docker.sock'

Describe issue

When passing docker socket on the command line, it gets ignored, and default is used instead.

If set via DOCKER_HOST environment variable, then it is picked up correctly.

I tested this with version 0.2.59 and that one works as expected, and the correct socket is used.

Link to GitHub repository

No response

Workflow content

N/A

Relevant log output

N/A

Additional information

No response

bretdavi89 commented 4 months ago

Actually just noticing that in newer version, it's treating docker host/socket separately: Using docker host 'unix:///var/run/docker.sock', and daemon socket 'unix:///run/user/1000/docker.sock'

So it is picking up the socket, but still trying to use the default one as well?

On the older version, simply passing the socket via the command line worked properly. Not sure why there are 2 variables for this

webjay commented 1 week ago

Same in act version 0.2.66