Previously, everything in the ci docker image ran as the root user. This would lead to certain directories (ci/scratch
, depends
) being owned by root
after running the ci locally which would lead to annoying behavior such as subsequent guix builds failing due to depends/
being owned by root.
This PR adds a non-root user in the container and chowns the mounted working directory. All the docker exec
commands now run as the non-root user, except for the few that still need to run as root (mainly, installing packages).
To test this I checked out a fresh copy of the repo, applied my changes, ran the CI, and verified all the local file permissions were unchanged after the CI was finished running.