Skip to content

Commit

Permalink
Build binaries statically (#786)
Browse files Browse the repository at this point in the history
This lets them run in the Alpine-based containers used in the CI/CD templates.
  • Loading branch information
MartinPetkov committed Feb 8, 2021
1 parent f71d421 commit e3e28d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion build/build-include.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function build_binaries() {
bin_name="$(basename ${build_dir})"
bin="${bin_name}_${VERSION}_${OS}-${ARCH}"
echo "Building ${OUTPUT_DIR}/${bin}"
env GOOS="${OS}" GOARCH="${ARCH}" go build -ldflags="-X 'github.com/GoogleCloudPlatform/healthcare-data-protection-suite/cmd.Version=${VERSION}' -X 'github.com/GoogleCloudPlatform/healthcare-data-protection-suite/cmd.BuildTime=${BUILD_TIME}'" -o "${OUTPUT_DIR}/${bin}" "${build_dir}"
env CGO_ENABLED=0 GOOS="${OS}" GOARCH="${ARCH}" go build -ldflags="-extldflags '-static' -X 'github.com/GoogleCloudPlatform/healthcare-data-protection-suite/cmd.Version=${VERSION}' -X 'github.com/GoogleCloudPlatform/healthcare-data-protection-suite/cmd.BuildTime=${BUILD_TIME}'" -o "${OUTPUT_DIR}/${bin}" "${build_dir}"
done
done
done
Expand Down

0 comments on commit e3e28d1

Please sign in to comment.