Skip to content

Commit

Permalink
contrib: Use tmp directory for macOS builder
Browse files Browse the repository at this point in the history
macOS SIP(System Integrity Protection) prevents use /root directory. So
the builder script fails on macOS. This commit makes the builder script
use /tmp directory instead of /root on macOS.

Signed-off-by: Gyutae Bae <gyu.8ae@gmail.com>
  • Loading branch information
gyutaeb authored and joestringer committed Feb 25, 2025
1 parent a03df46 commit d582b6a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions contrib/scripts/builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ CILIUM_BUILDER_IMAGE=$(cat images/cilium/Dockerfile | grep '^ARG CILIUM_BUILDER_
USER_OPTION=""
USER_PATH="/root"

if [[ "$(uname -s)" == "Darwin" ]]; then
USER_PATH="/tmp"
fi

if [ -n "${RUN_AS_NONROOT:-}" ]; then
USER_OPTION="--user $(id -u):$(id -g)"
USER_PATH="$HOME"
Expand Down

0 comments on commit d582b6a

Please sign in to comment.