added fixes for make dev-env (#8804)

This commit is contained in:
Long Wu Yuan 2022-07-21 06:27:44 +05:30 committed by GitHub
parent 4c6a7ee158
commit 0cc43d5e52
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 1 deletions

View file

@ -54,8 +54,9 @@ ifneq ($(PLATFORM),)
endif
MAC_OS = $(shell uname -s)
ifeq ($(MAC_OS), Darwin)
MAC_DOCKER_FLAGS="--load"
MAC_DOCKER_FLAGS=
else
MAC_DOCKER_FLAGS=
endif

View file

@ -49,6 +49,7 @@ echo "Building targets for ${ARCH}, generated targets in ${TARGETS_DIR} director
echo "Building ${PKG}/cmd/nginx"
git config --add safe.directory /go/src/k8s.io/ingress-nginx
${GO_BUILD_CMD} \
-trimpath -ldflags="-buildid= -w -s \
-X ${PKG}/version.RELEASE=${TAG} \

View file

@ -65,12 +65,14 @@ fi
USER=${USER:-nobody}
MAC_OS="`uname -s`"
MAC_OS="${MAC_OS:-}"
if [[ ${MAC_OS} == "Darwin" ]]; then
MAC_DOCKER_FLAGS=""
else
MAC_DOCKER_FLAGS="-u $(id -u ${USER}):$(id -g ${USER})" #idk why mac/git fails on the gobuild if these are presented to dockerrun.sh script
fi
echo "MAC_OS = ${MAC_OS}, MAC_OS_FLAGS = ${MAC_DOCKER_FLAGS}"
echo "..printing env & other vars to stdout"
echo "HOSTNAME=`hostname`"