Files created by the build are owned by root, not "runner"
See original GitHub issueBug description
After building using the unity-builder github actions, the output files are owned by root.root
instead of runner.docker
like the files in git.
How to reproduce
Build.
Expected behavior
Files can be modified by the github actions
Additional details
The root cause here is that my build doesn’t build to build/${{ targetPlatform }}/${{ targetPlatform}}.$EXTENSION, but somewhere else, and so I want to move the output around afterwards in the github workflow rather than in the build function, but I can’t because of permissions. But it seems like, in general, this would be a better practice to run chown
within the docker before finishing.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Files created by Docker container are owned by root
The files are created by the user that runs within the container. Iif your containerized command runs as root , then all files...
Read more >Dockerfile: ADD does not honor USER: files always owned ...
Hi, consider this Dockerfile: FROM ubuntu RUN adduser foo USER foo ADD . /foo /foo in the container will be owned by root,...
Read more >How do I make sure that files created by container are not ...
I believe if the folder thats being mounted does not exist when spinning up the container you get files/folders owned by root. Try...
Read more >Docker container creating directories owned by root, I need ...
Creating a /Downloads/temp was essential here or else it gave an error because it couldn't create its own because it's not running as...
Read more >Running a Docker container as a non-root user
The Problem: Docker writes files as root. Sometimes, when we run builds in Docker containers, the build creates files in a folder that's...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Okay, I had a little problem re-implementing #141, the license activation step was tripping up because the runner user’s $HOME wasn’t set correctly. Setting it manually to “/github/home” solves this issue: https://github.com/game-ci/unity-builder/compare/main...Bradshaw:fix-root-files-and-android
I’m now taking a look at the sdkmanager issue, and will try to solve it in a way that doesn’t require running as root
Good point. I probably should have opened this on the GH action. We can get the name, though, by passing in the result of
$(whoami)
or$(id)
.From the workflow, while we have permissions to delete the files, a chown (or for that matter, chmod, which is what I really need) failed with “permission denied”.