question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Files created by the build are owned by root, not "runner"

See original GitHub issue

Bug 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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Bradshawcommented, Apr 14, 2021

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

1reaction
mikeagecommented, Feb 20, 2021

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”.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found