chore: Support running dockerized toolchain using sudo #11955
Merged
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.
Previously, when a user was not part of the
docker
group, they had to run the make targets for the dockerized toolchain usingsudo
in order to leverage Docker. This could have led to lots of fscked up permissions in the source tree.This small fix for the toolchain adds support for properly using
sudo
to leveragedocker
, instead of relying on the user to be member of the (privileged)docker
group.User can now just run:
SUDO=sudo make <target>
and the Makefile will leverage sudo as appropriate. This also allows to specify to impersonate other users, e.g. by settingSUDO="sudo -u foobar" make <target>
The change also removes a lot of
chmod -R 777
from the test container's Dockerfile, which were added as a result of mixed user ids accessing the same set of files. These chmod's were both slow, and insecure.Signed-off-by: jannfis jann@mistrust.net
Note on DCO:
If the DCO action in the integration test fails, one or more of your commits are not signed off. Please click on the Details link next to the DCO action for instructions on how to resolve this.
Checklist: