Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Apr 17, 2023

Conversation

mumoshu
Copy link
Collaborator

@mumoshu mumoshu commented Apr 11, 2023

#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

#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
Copy link
Collaborator

@Link- Link- left a comment

Choose a reason for hiding this comment

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

🚀 ship it!

@mumoshu
Copy link
Collaborator Author

mumoshu commented Apr 17, 2023

Thanks for your review @Link-! Merging.

@mumoshu mumoshu merged commit 3e0bc3f into master Apr 17, 2023
13 checks passed
@mumoshu mumoshu deleted the fix-docker-sock-perm-error branch April 17, 2023 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants