From 37d92ceb7ac8c2568799aada0b455b5c9fa1746c Mon Sep 17 00:00:00 2001 From: doujiang24 Date: Fri, 4 Nov 2022 11:35:06 +0800 Subject: [PATCH] improve the run_envoy_docker.sh compatibility on mac. Since the stat on mac missing the -c option, i.e. stat: illegal option -- c usage: stat [-FLnq] [-f format | -l | -r | -s | -x] [-t timefmt] [file ...] Signed-off-by: doujiang24 --- ci/run_envoy_docker.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/run_envoy_docker.sh b/ci/run_envoy_docker.sh index cad4b993cd2f1..49eac0cb67fbe 100755 --- a/ci/run_envoy_docker.sh +++ b/ci/run_envoy_docker.sh @@ -41,7 +41,7 @@ else BUILD_DIR_MOUNT_DEST=/build SOURCE_DIR="${PWD}" SOURCE_DIR_MOUNT_DEST=/source - DOCKER_GID="$(stat -c '%g' /var/run/docker.sock)" + DOCKER_GID="$(stat -c %g /var/run/docker.sock 2>/dev/null || stat -f %g /var/run/docker.sock)" START_COMMAND=("/bin/bash" "-lc" "groupadd --gid ${DOCKER_GID} -f envoygroup \ && useradd -o --uid $(id -u) --gid ${DOCKER_GID} --no-create-home --home-dir /build envoybuild \ && usermod -a -G pcap envoybuild \