Fix permission denied errors due to root-owned directories - #27
Open
atrosinenko wants to merge 1 commit into
Open
Fix permission denied errors due to root-owned directories#27atrosinenko wants to merge 1 commit into
atrosinenko wants to merge 1 commit into
Conversation
Build inside the container is performed by the `root` user, who owns the produced build artifacts which are written to the host directories mounted as volumes. The most important outcome of this is that running `./build.sh host-build` after the `./ccache` directory was populated by an earlier containerized build results in the `host-build` silently disabling the build cache. Fixing this may involve duplicating the non-privileged UID from the host to the container, so that all build artifacts are owned by the correct user from the beginning. This patch implements a simpler ad-hoc approach of using two separate cache directories: root-owned `ccache-docker` for containerized builds and `ccache-host` owned by the regular user. Furthermore, this patch makes `build.sh` pre-create the top-level directories before mounting them via `docker run --volume ...` (assuming `docker` and thus the `build.sh` script can be run by the regular user without `sudo`).
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.
Build inside the container is performed by the
rootuser, who owns the produced build artifacts which are written to the host directories mounted as volumes. The most important outcome of this is that running./build.sh host-buildafter the./ccachedirectory was populated by an earlier containerized build results in thehost-buildsilently disabling the build cache.Fixing this may involve duplicating the non-privileged UID from the host to the container, so that all build artifacts are owned by the correct user from the beginning. This patch implements a simpler ad-hoc approach of using two separate cache directories: root-owned
ccache-dockerfor containerized builds andccache-hostowned by the regular user.Furthermore, this patch makes
build.shpre-create the top-level directories before mounting them viadocker run --volume ...(assumingdockerand thus thebuild.shscript can be run by the regular user withoutsudo).