Lines Matching +full:docker +full:- +full:run
2 # SPDX-License-Identifier: BSD-3-Clause
14 # The main use case is to run this first thing inside a container to
17 # `docker run --user=$(id -un) ...` achieves something very similar
21 # To understand more about the Docker problem solved here take a look at
22 …s://stackoverflow.com/questions/35291520/docker-and-userns-remap-how-to-manage-volume-permissions-…
27 set -e
28 set -x
32 cwd_uid="$(stat --printf='%u' .)"
33 local current_uid; current_uid="$(id -u)"
47 local cwd_guid; cwd_guid="$(stat --printf='%g' .)"
50 sudo groupadd -g "$cwd_guid" 'cwd_group'
52 sudo useradd -m -u "$cwd_uid" -g "$cwd_guid" "$cwd_user"
54 local current_user; current_user="$(id -un)"
57 if test -e /etc/sudoers.d/"$current_user"; then
58 sudo sed -e "s/$current_user/$cwd_user/" /etc/sudoers.d/"$current_user" |
59 sudo tee -a /etc/sudoers.d/"$cwd_user"
60 sudo chmod --reference=/etc/sudoers.d/"$current_user" \
66 # zephyr-build:/etc/sudoers: 'user' can do anything but... only as
70 sudo sudo -u "$cwd_user" REAL_CC="$REAL_CC" \