Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] fix git safe dir error #807

Merged
merged 1 commit into from
Apr 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions hack/lib/release-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,12 @@ function get_version {


function build_multi_arch_binaries() {
local docker_yurt_root="/opt/src"
local docker_run_opts=(
"-i"
"--rm"
"--network host"
"-v ${YURT_ROOT}:/opt/src"
"-v ${YURT_ROOT}:${docker_yurt_root}"
"--env CGO_ENABLED=0"
"--env GOOS=${SUPPORTED_OS}"
"--env PROJECT_PREFIX=${PROJECT_PREFIX}"
Expand All @@ -100,12 +101,13 @@ function build_multi_arch_binaries() {

local sub_commands="sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories; \
apk --no-cache add bash git; \
cd /opt/src; umask 0022; \
rm -rf ${YURT_LOCAL_BIN_DIR}/* ;"
cd ${docker_yurt_root}; umask 0022; \
rm -rf ${YURT_LOCAL_BIN_DIR}/* ; \
git config --global --add safe.directory ${docker_yurt_root};"
for arch in ${target_arch[@]}; do
sub_commands+="GOARCH=$arch bash ./hack/make-rules/build.sh $(echo ${bin_targets_process_servant[@]}); "
done
sub_commands+="chown -R $(id -u):$(id -g) /opt/src/_output"
sub_commands+="chown -R $(id -u):$(id -g) ${docker_yurt_root}/_output"

docker run ${docker_run_opts[@]} ${YURT_BUILD_IMAGE} ${docker_run_cmd[@]} "${sub_commands}"
}
Expand Down