mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 17:08:53 +00:00
Explicitly disable CGO in build (#2229)
Fleet does not use CGO. In some build situations, not explicitly disabling CGO results in binaries that have linking errors when running on an Alpine Docker container. This change should fix the build for those containers.
This commit is contained in:
parent
04c9acce96
commit
ed79c00341
1 changed files with 9 additions and 9 deletions
18
Makefile
18
Makefile
|
|
@ -107,10 +107,10 @@ endif
|
|||
build: fleet fleetctl
|
||||
|
||||
fleet: .prefix .pre-build .pre-fleet
|
||||
go build -tags full -i -o build/${OUTPUT} -ldflags ${KIT_VERSION} ./cmd/fleet
|
||||
CGO_ENABLED=0 go build -tags full -i -o build/${OUTPUT} -ldflags ${KIT_VERSION} ./cmd/fleet
|
||||
|
||||
fleetctl: .prefix .pre-build .pre-fleetctl
|
||||
go build -tags full -i -o build/fleetctl -ldflags ${KIT_VERSION} ./cmd/fleetctl
|
||||
CGO_ENABLED=0 go build -tags full -i -o build/fleetctl -ldflags ${KIT_VERSION} ./cmd/fleetctl
|
||||
|
||||
lint-js:
|
||||
yarn run eslint frontend --ext .js,.jsx
|
||||
|
|
@ -196,7 +196,7 @@ docker-push-release: docker-build-release
|
|||
|
||||
docker-build-circle:
|
||||
@echo ">> building docker image"
|
||||
GOOS=linux go build -i -o build/linux/${OUTPUT} -ldflags ${KIT_VERSION} ./cmd/fleet
|
||||
CGO_ENABLED=0 GOOS=linux go build -i -o build/linux/${OUTPUT} -ldflags ${KIT_VERSION} ./cmd/fleet
|
||||
docker build -t "${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_TAG}" .
|
||||
docker push "${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_TAG}"
|
||||
|
||||
|
|
@ -217,14 +217,14 @@ demo-restore:
|
|||
mkdir -p build/binary-bundle/darwin
|
||||
|
||||
xp-fleet: .pre-binary-bundle .pre-fleet generate
|
||||
GOOS=linux go build -tags full -i -o build/binary-bundle/linux/fleet -ldflags ${KIT_VERSION} ./cmd/fleet
|
||||
GOOS=darwin go build -tags full -i -o build/binary-bundle/darwin/fleet -ldflags ${KIT_VERSION} ./cmd/fleet
|
||||
GOOS=windows go build -tags full -i -o build/binary-bundle/windows/fleet.exe -ldflags ${KIT_VERSION} ./cmd/fleet
|
||||
CGO_ENABLED=0 GOOS=linux go build -tags full -i -o build/binary-bundle/linux/fleet -ldflags ${KIT_VERSION} ./cmd/fleet
|
||||
CGO_ENABLED=0 GOOS=darwin go build -tags full -i -o build/binary-bundle/darwin/fleet -ldflags ${KIT_VERSION} ./cmd/fleet
|
||||
CGO_ENABLED=0 GOOS=windows go build -tags full -i -o build/binary-bundle/windows/fleet.exe -ldflags ${KIT_VERSION} ./cmd/fleet
|
||||
|
||||
xp-fleetctl: .pre-binary-bundle .pre-fleetctl generate
|
||||
GOOS=linux go build -tags full -i -o build/binary-bundle/linux/fleetctl -ldflags ${KIT_VERSION} ./cmd/fleetctl
|
||||
GOOS=darwin go build -tags full -i -o build/binary-bundle/darwin/fleetctl -ldflags ${KIT_VERSION} ./cmd/fleetctl
|
||||
GOOS=windows go build -tags full -i -o build/binary-bundle/windows/fleetctl.exe -ldflags ${KIT_VERSION} ./cmd/fleetctl
|
||||
CGO_ENABLED=0 GOOS=linux go build -tags full -i -o build/binary-bundle/linux/fleetctl -ldflags ${KIT_VERSION} ./cmd/fleetctl
|
||||
CGO_ENABLED=0 GOOS=darwin go build -tags full -i -o build/binary-bundle/darwin/fleetctl -ldflags ${KIT_VERSION} ./cmd/fleetctl
|
||||
CGO_ENABLED=0 GOOS=windows go build -tags full -i -o build/binary-bundle/windows/fleetctl.exe -ldflags ${KIT_VERSION} ./cmd/fleetctl
|
||||
|
||||
binary-bundle: xp-fleet xp-fleetctl
|
||||
cd build/binary-bundle && zip -r "fleet_${VERSION}.zip" darwin/ linux/ windows/
|
||||
|
|
|
|||
Loading…
Reference in a new issue