[GH-ISSUE #1798] Linux support for access to docker.socket #878

Open
opened 2026-03-01 21:47:06 +03:00 by kerem · 5 comments
Owner

Originally created by @andrew-pickin-epi on GitHub (May 10, 2023).
Original GitHub issue: https://github.com/nektos/act/issues/1798

Act version

0.2.45-10

Feature description

Unless by some chance the gid of docker group on host machine and runner image coincide the docker.socket will give permissions denied error when attempting to run docker build or similar command.

There are ways round this,

  • chown 1001 /var/run/docker.sock
  • chmod a+rw /var/run/docker.sock

But these might conflict with other needs, not survive a reboot.

It should be possible to read the gid of /var/run/docker.sock on startup and add this value to the invocation of the runner image. (See docker run --group-add).

Originally created by @andrew-pickin-epi on GitHub (May 10, 2023). Original GitHub issue: https://github.com/nektos/act/issues/1798 ### Act version 0.2.45-10 ### Feature description Unless by some chance the gid of docker group on host machine and runner image coincide the docker.socket will give permissions denied error when attempting to run docker build or similar command. There are ways round this, - `chown 1001 /var/run/docker.sock` - `chmod a+rw /var/run/docker.sock` But these might conflict with other needs, not survive a reboot. It should be possible to read the `gid` of `/var/run/docker.sock` on startup and add this value to the invocation of the runner image. (See `docker run --group-add`).
Author
Owner

@fabiobsantosprogrow commented on GitHub (Feb 2, 2024):

Got the same error today!
After searching one hour on issues and stack overflow found this post.
I have the same issue when using docker compose too but docker-compose was a optional as dependency.

<!-- gh-comment-id:1923693430 --> @fabiobsantosprogrow commented on GitHub (Feb 2, 2024): Got the same error today! After searching one hour on issues and stack overflow found this post. I have the same issue when using docker compose too but docker-compose was a optional as dependency.
Author
Owner

@alexjball commented on GitHub (Apr 2, 2024):

In my setup, chown and chmoding the docker socket changes permissions on both the host and container, breaking docker on my host.

Instead, I was able to use --container-options to pass in --group-add to workflow containers, which does the trick:

act --container-options "--group-add $(stat -c %g /var/run/docker.sock)" ...
<!-- gh-comment-id:2030908166 --> @alexjball commented on GitHub (Apr 2, 2024): In my setup, `chown` and `chmod`ing the docker socket changes permissions on both the host and container, breaking docker on my host. Instead, I was able to use `--container-options` to pass in `--group-add` to workflow containers, which does the trick: ```bash act --container-options "--group-add $(stat -c %g /var/run/docker.sock)" ... ```
Author
Owner

@mahula commented on GitHub (May 6, 2024):

act --container-options "--group-add $(stat -c %g /var/run/docker.sock)"

Thank you, that solved the docker access issue.

<!-- gh-comment-id:2096800652 --> @mahula commented on GitHub (May 6, 2024): > ```shell > act --container-options "--group-add $(stat -c %g /var/run/docker.sock)" > ``` Thank you, that solved the docker access issue.
Author
Owner

@jonathanlinat commented on GitHub (Jun 21, 2024):

In my setup, chown and chmoding the docker socket changes permissions on both the host and container, breaking docker on my host.

Instead, I was able to use --container-options to pass in --group-add to workflow containers, which does the trick:

act --container-options "--group-add $(stat -c %g /var/run/docker.sock)" ...

It still does not work, unfortunately.

jonathan@work-pc:~/Projects/Professional/my-project$ gh act --container-options "--group-add $(stat -c %g /var/run/docker.sock)" pull_request
INFO[0000] Using docker host 'unix:///var/run/docker.sock', and daemon socket 'unix:///var/run/docker.sock' 
[Continuous Deployment - Content Migrations/Set the environment outputs] 🚀  Start image=catthehacker/ubuntu:act-latest
[Continuous Deployment - Docs/Set the environment outputs              ] 🚀  Start image=catthehacker/ubuntu:act-latest
[Continuous Deployment - Storybook/Set the environment outputs         ] 🚀  Start image=catthehacker/ubuntu:act-latest
[Continuous Integration/Lint the source code                           ] 🚀  Start image=catthehacker/ubuntu:act-latest
[Continuous Deployment - Storefront/Set the environment outputs        ] 🚀  Start image=catthehacker/ubuntu:act-latest
[Continuous Deployment - Content Migrations/Set the environment outputs]   🐳  docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=true
[Continuous Deployment - Terraform/Set the environment outputs         ] 🚀  Start image=catthehacker/ubuntu:act-latest
[Continuous Integration/Lint the source code                           ]   🐳  docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=true
[Continuous Integration/Unit test the packages                         ] 🚀  Start image=catthehacker/ubuntu:act-latest
[Continuous Deployment - Docs/Set the environment outputs              ]   🐳  docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=true
[Continuous Deployment - Storybook/Set the environment outputs         ]   🐳  docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=true
[Continuous Integration/Unit test the packages                         ]   🐳  docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=true
[Continuous Deployment - Storefront/Set the environment outputs        ]   🐳  docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=true
[Continuous Deployment - Terraform/Set the environment outputs         ]   🐳  docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=true
Error: permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/images/create?fromImage=catthehacker%2Fubuntu&tag=act-latest": dial unix /var/run/docker.sock: connect: permission denied

Update

It worked using the following command instead:

gh act -P ubuntu-latest=-self-hosted
<!-- gh-comment-id:2183291657 --> @jonathanlinat commented on GitHub (Jun 21, 2024): > In my setup, `chown` and `chmod`ing the docker socket changes permissions on both the host and container, breaking docker on my host. > > Instead, I was able to use `--container-options` to pass in `--group-add` to workflow containers, which does the trick: > > ```shell > act --container-options "--group-add $(stat -c %g /var/run/docker.sock)" ... > ``` It still does not work, unfortunately. ```bash jonathan@work-pc:~/Projects/Professional/my-project$ gh act --container-options "--group-add $(stat -c %g /var/run/docker.sock)" pull_request INFO[0000] Using docker host 'unix:///var/run/docker.sock', and daemon socket 'unix:///var/run/docker.sock' [Continuous Deployment - Content Migrations/Set the environment outputs] 🚀 Start image=catthehacker/ubuntu:act-latest [Continuous Deployment - Docs/Set the environment outputs ] 🚀 Start image=catthehacker/ubuntu:act-latest [Continuous Deployment - Storybook/Set the environment outputs ] 🚀 Start image=catthehacker/ubuntu:act-latest [Continuous Integration/Lint the source code ] 🚀 Start image=catthehacker/ubuntu:act-latest [Continuous Deployment - Storefront/Set the environment outputs ] 🚀 Start image=catthehacker/ubuntu:act-latest [Continuous Deployment - Content Migrations/Set the environment outputs] 🐳 docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=true [Continuous Deployment - Terraform/Set the environment outputs ] 🚀 Start image=catthehacker/ubuntu:act-latest [Continuous Integration/Lint the source code ] 🐳 docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=true [Continuous Integration/Unit test the packages ] 🚀 Start image=catthehacker/ubuntu:act-latest [Continuous Deployment - Docs/Set the environment outputs ] 🐳 docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=true [Continuous Deployment - Storybook/Set the environment outputs ] 🐳 docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=true [Continuous Integration/Unit test the packages ] 🐳 docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=true [Continuous Deployment - Storefront/Set the environment outputs ] 🐳 docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=true [Continuous Deployment - Terraform/Set the environment outputs ] 🐳 docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=true Error: permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/images/create?fromImage=catthehacker%2Fubuntu&tag=act-latest": dial unix /var/run/docker.sock: connect: permission denied ``` --- **Update** It worked using the following command instead: ```bash gh act -P ubuntu-latest=-self-hosted ```
Author
Owner

@piotrpdev commented on GitHub (Jun 23, 2025):

@jonathanlinat
It still does not work, unfortunately.

Did you try this?

act --container-options="--privileged"
<!-- gh-comment-id:2996766552 --> @piotrpdev commented on GitHub (Jun 23, 2025): > @jonathanlinat > It still does not work, unfortunately. Did you try this? ```bash act --container-options="--privileged" ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#878
No description provided.