Skip to content

Commit

Permalink
Merge pull request #3155 from bobbypage/cgo
Browse files Browse the repository at this point in the history
Disable cgo for static binaries
  • Loading branch information
bobbypage authored Nov 4, 2022
2 parents 24dd1de + e2a6855 commit c1a39fd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ set -e

export GOOS=${GOOS:-$(go env GOOS)}
export GOARCH=${GOARCH:-$(go env GOARCH)}
export CGO_ENABLED=${GO_CGO_ENABLED:-"1"}
GO_FLAGS=${GO_FLAGS:-"-tags netgo"} # Extra go flags to use in the build.
BUILD_USER=${BUILD_USER:-"${USER}@${HOSTNAME}"}
BUILD_DATE=${BUILD_DATE:-$( date +%Y%m%d-%H:%M:%S )}
Expand Down
2 changes: 1 addition & 1 deletion build/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ for arch in "${arches[@]}"; do
done

for arch in "${!arches[@]}"; do
GOARCH="$arch" OUTPUT_NAME_WITH_ARCH="true" build/build.sh
GOARCH="$arch" GO_CGO_ENABLED="0" OUTPUT_NAME_WITH_ARCH="true" build/build.sh
arch_specific_image="${image_name}-${arch}:${VERSION}"
docker buildx build --platform "linux/${arch}" --build-arg VERSION="$VERSION" -f deploy/Dockerfile -t "$arch_specific_image" --progress plain --push .
docker manifest create --amend "$final_image" "$arch_specific_image"
Expand Down

0 comments on commit c1a39fd

Please sign in to comment.