Skip to content

Commit

Permalink
fix: fix cicd permission issues
Browse files Browse the repository at this point in the history
  • Loading branch information
riccardopinosio committed Mar 21, 2024
1 parent 7e5ca25 commit e39c981
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions scripts/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,15 @@ user_name=testuser # the container non-privileged user (see dockerfile)

if [[ -n $HOST_UID ]] && [[ $HOST_UID != 1000 ]]; then
# patching internal $user_name to have the required host user id
echo "patching $testuser with $HOST_UID"
usermod -u "$HOST_UID" $user_name
fi

if [[ -d "/build" ]]; then
echo "patching build directory"
chown -R testuser:testuser /build
fi

echo "$1 running with user: $user_name"
chown "$user_name:$user_name" "$1" && chmod +x "$1"
exec runuser -u $user_name -- "$1" "${arguments[@]}"

0 comments on commit e39c981

Please sign in to comment.