docker: run rootless as the current user without requiring sudo - #1319
Merged
Conversation
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
vvoland
reviewed
Sep 11, 2026
| await core.group('Docker daemon logs', async () => { | ||
| await Exec.exec('sudo', ['cat', path.join(this.runDir, 'dockerd.log')], {ignoreReturnCode: true}); | ||
| const args = [path.join(this.runDir, 'dockerd.log')]; | ||
| await Exec.exec(this.rootless ? 'cat' : 'sudo', this.rootless ? args : ['cat', ...args], {ignoreReturnCode: true}); |
Contributor
There was a problem hiding this comment.
Will require a follow up in setup-docker-action to also pass rootless to new Install for the teardown:
(it's really fishy that we just don't use the same object for both though!)
Member
Author
There was a problem hiding this comment.
Good catch, I missed the separate construction in post. I'll pass the rootless input there when updating the toolkit dependency. Main and post run in separate processes, so we need to reconstruct the instance, but the teardown options should match.
vvoland
approved these changes
Sep 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes docker/setup-docker-action#152
Rootless Docker now starts as the current user instead of switching to hard-coded UID 1001 through sudo. Cleanup also runs without sudo, using RootlessKit to remove files owned by subordinate UIDs. The GitHub-hosted AppArmor workaround is best-effort, so it no longer blocks container jobs where sudo is unavailable.