Skip to content

Fix docker.sock permission error for non-dind Ubuntu 20.04 runners since v0.27.2 - #2499

Merged
mumoshu merged 1 commit into
masterfrom
fix-docker-sock-perm-error
Apr 17, 2023
Merged

mumoshu merged 1 commit into
masterfrom
fix-docker-sock-perm-error

Conversation

@mumoshu

@mumoshu mumoshu commented Apr 11, 2023 •

Copy link
Copy Markdown
Collaborator

#2490 has been happening since v0.27.2 for non-dind runners based on Ubuntu 20.04 runner images. It does not affect Ubuntu 22.04 non-dind runners(i.e. runners with dockerd sidecars) and Ubuntu 20.04/22.04 dind runners(i.e. runners without dockerd sidecars). However, presuming many folks are still using Ubuntu 20.04 runners and non-dind runners, we should fix it.

This change tries to fix it by defaulting to the docker group id 1001 used by Ubuntu 20.04 runners, and use gid 121 for Ubuntu 22.04 runners. We use the image tag to see which Ubuntu version the runner is based on. The algorithm is so simple- we assume it's Ubuntu-22.04-based if the image tag contains "22.04".

This might be a breaking change for folks who have already upgraded to Ubuntu 22.04 runners using their own custom runner images. Note again; we rely on the image tag to detect Ubuntu 22.04 runner images and use the proper docker gid- Folks using our official Ubuntu 22.04 runner images are not affected. It is a breaking change anyway, so I have added a remedy-

ARC got a new flag, --docker-gid, which defaults to 1001 but can be set to 121 or whatever gid the operator/admin likes. This can be set to --docker-gid=121, for example, if you are using your own custom runner image based on Ubuntu 22.04 and the image tag does not contain "22.04".

Fixes #2490

@mumoshu
mumoshu requested review from a team, nikola-jokic and toast-gear as code owners April 11, 2023 02:13
#2490 has been happening since v0.27.2 for non-dind runners based on Ubuntu 20.04 runner images. It does not affect Ubuntu 22.04 runners and Unbut 20.04/22.04 dind runners. Presuming many folks are still using Ubuntu 20.04 runners and non-dind runners, we should fix it.

This change tries to fix it by defaulting to the docker group id 1001 used by Ubuntu 20.04 runners, and use gid 121 for Ubuntu 22.04 runners. We use image tags to see which Ubuntu version the runner is basaed on.

This might be a breaking change for folks who had already upgraded to Ubuntu 22.04 runners using their own custom runner images. Note again, we rely on the image tag to detect Ubuntu 22.04 runner images and use the proper docker gid- Folks using our official Ubuntu 22.04 runner images are not affected. It is a breaking change anyway so I have added a remedy-

ARC got a new flag, `--docker-gid`, which defaults to `1001` but can be set to `121` or whatever gid the operator/admin likes. This can be set to `121`, for example, if you are using your own custom runner image based Ubuntu 22.04 and the image tag does not contain "22.04".

Fixes #2490

@Link- Link- left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 ship it!

@mumoshu

mumoshu commented Apr 17, 2023

Copy link
Copy Markdown
Collaborator Author

Thanks for your review @Link-! Merging.

@mumoshu
mumoshu merged commit 3e0bc3f into master Apr 17, 2023
@mumoshu
mumoshu deleted the fix-docker-sock-perm-error branch April 17, 2023 12:30
unpollito pushed a commit to DistruApp/actions-runner-controller that referenced this pull request Jan 21, 2026
…nce v0.27.2 (actions#2499)

actions#2490 has been happening since v0.27.2 for non-dind runners based on Ubuntu 20.04 runner images. It does not affect Ubuntu 22.04 non-dind runners(i.e. runners with dockerd sidecars) and Ubuntu 20.04/22.04 dind runners(i.e. runners without dockerd sidecars). However, presuming many folks are still using Ubuntu 20.04 runners and non-dind runners, we should fix it.

This change tries to fix it by defaulting to the docker group id 1001 used by Ubuntu 20.04 runners, and use gid 121 for Ubuntu 22.04 runners. We use the image tag to see which Ubuntu version the runner is based on. The algorithm is so simple- we assume it's Ubuntu-22.04-based if the image tag contains "22.04".

This might be a breaking change for folks who have already upgraded to Ubuntu 22.04 runners using their own custom runner images. Note again; we rely on the image tag to detect Ubuntu 22.04 runner images and use the proper docker gid- Folks using our official Ubuntu 22.04 runner images are not affected. It is a breaking change anyway, so I have added a remedy-

ARC got a new flag, `--docker-gid`, which defaults to `1001` but can be set to `121` or whatever gid the operator/admin likes. This can be set to `--docker-gid=121`, for example, if you are using your own custom runner image based on Ubuntu 22.04 and the image tag does not contain "22.04".

Fixes actions#2490
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Runners created by a 0.27.2 controller failing with dial unix /run/docker/docker.sock: connect: permission denied

2 participants