scripts: dev_cli: Run unprivileged containers as the host user
By default we will run as root inside the container, which means all the build artifacts will be owned by root. That prevents us from properly cleaning our build from an unprivileged host user. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
parent
26d8caedb6
commit
c8fa8092c5
1 changed files with 3 additions and 0 deletions
|
|
@ -163,6 +163,7 @@ cmd_build() {
|
|||
[ $build = "release" ] && cargo_args+=("--release")
|
||||
|
||||
$DOCKER_RUNTIME run \
|
||||
--user "$(id -u):$(id -g)" \
|
||||
--workdir "$CTR_CLH_ROOT_DIR" \
|
||||
--rm \
|
||||
--volume /dev:/dev \
|
||||
|
|
@ -186,6 +187,7 @@ cmd_clean() {
|
|||
cargo_args=("$@")
|
||||
|
||||
$DOCKER_RUNTIME run \
|
||||
--user "$(id -u):$(id -g)" \
|
||||
--workdir "$CTR_CLH_ROOT_DIR" \
|
||||
--rm \
|
||||
--volume "$CLH_ROOT_DIR:$CTR_CLH_ROOT_DIR" \
|
||||
|
|
@ -230,6 +232,7 @@ cmd_tests() {
|
|||
if [ "$cargo" = true ] ; then
|
||||
say "Running cargo tests..."
|
||||
$DOCKER_RUNTIME run \
|
||||
--user "$(id -u):$(id -g)" \
|
||||
--workdir "$CTR_CLH_ROOT_DIR" \
|
||||
--rm \
|
||||
--volume "$CLH_ROOT_DIR:$CTR_CLH_ROOT_DIR" \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue