{"id":18920968,"url":"https://github.com/gnat/rootless-docker-file-ownership","last_synced_at":"2026-03-13T11:30:18.685Z","repository":{"id":149186775,"uuid":"470573315","full_name":"gnat/rootless-docker-file-ownership","owner":"gnat","description":"👤 Reclaim file ownership back to user who starts a rootless container (1000), from the container operating User (100998, 100000 ...)","archived":false,"fork":false,"pushed_at":"2022-03-16T12:44:17.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-31T16:50:19.347Z","etag":null,"topics":["rootless-docker"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gnat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-16T12:28:31.000Z","updated_at":"2022-03-16T12:40:35.000Z","dependencies_parsed_at":"2023-09-03T03:45:25.138Z","dependency_job_id":null,"html_url":"https://github.com/gnat/rootless-docker-file-ownership","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnat%2Frootless-docker-file-ownership","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnat%2Frootless-docker-file-ownership/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnat%2Frootless-docker-file-ownership/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnat%2Frootless-docker-file-ownership/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gnat","download_url":"https://codeload.github.com/gnat/rootless-docker-file-ownership/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239921872,"owners_count":19718841,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["rootless-docker"],"created_at":"2024-11-08T10:44:55.394Z","updated_at":"2026-03-13T11:30:18.638Z","avatar_url":"https://github.com/gnat.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rootless Docker File Ownership Helper\n\nTo help people running into this blocker until Docker gets around to resolving this issue.\n\nReclaim file ownership back to user who starts a rootless container (1000), from the container operating User (typically 100998, 100000 ...)\n\n### docker_reclaim.sh\n```bash\n#!/bin/bash\n\n# Reclaims permissions back to the invoking user (from rootless docker 100000+ UID operating users)\n# You can also: sudo chown ${USER}:${USER} -R .\n# Great for git commits and backups.\n# This script can be removed one day if rootless docker handles it, or if we switch to podman (slower than docker as of this writing).\n\nset -x\nnsenter -U --preserve-credentials -n -m -t $(cat $XDG_RUNTIME_DIR/docker.pid) /usr/bin/chown -R root:root $(pwd)\n```\n\n### Friendly reminders\n* root from within the container namespace refers to the non-root invoking User. \n* Rootless Docker currently does not handle this as of this writing (March 2022).\n\n### References\n* https://man7.org/linux/man-pages/man1/nsenter.1.html\n* https://www.redhat.com/sysadmin/container-namespaces-nsenter\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgnat%2Frootless-docker-file-ownership","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgnat%2Frootless-docker-file-ownership","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgnat%2Frootless-docker-file-ownership/lists"}