1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2024-11-26 09:01:00 +02:00

Disable cgo on release builds

Tries to link against libc which isn't present in musl based distributions (such as Alpine Linux).

Closes https://github.com/pusher/oauth2_proxy/issues/329
This commit is contained in:
Tom Elliff 2020-01-28 09:05:04 +00:00
parent d9362d3bb9
commit 1d808a47d1

View File

@ -27,10 +27,10 @@ for ARCH in "${ARCHS[@]}"; do
# Create architecture specific binaries # Create architecture specific binaries
if [[ ${GO_ARCH} == "armv6" ]]; then if [[ ${GO_ARCH} == "armv6" ]]; then
GO111MODULE=on GOOS=${GO_OS} GOARCH=arm GOARM=6 go build -ldflags="-X main.VERSION=${VERSION}" \ GO111MODULE=on GOOS=${GO_OS} GOARCH=arm GOARM=6 CGO_ENABLED=0 go build -ldflags="-X main.VERSION=${VERSION}" \
-o release/${BINARY}-${VERSION}.${ARCH}.${GO_VERSION}/${BINARY} github.com/pusher/oauth2_proxy -o release/${BINARY}-${VERSION}.${ARCH}.${GO_VERSION}/${BINARY} github.com/pusher/oauth2_proxy
else else
GO111MODULE=on GOOS=${GO_OS} GOARCH=${GO_ARCH} go build -ldflags="-X main.VERSION=${VERSION}" \ GO111MODULE=on GOOS=${GO_OS} GOARCH=${GO_ARCH} CGO_ENABLED=0 go build -ldflags="-X main.VERSION=${VERSION}" \
-o release/${BINARY}-${VERSION}.${ARCH}.${GO_VERSION}/${BINARY} github.com/pusher/oauth2_proxy -o release/${BINARY}-${VERSION}.${ARCH}.${GO_VERSION}/${BINARY} github.com/pusher/oauth2_proxy
fi fi