Skip to content

Commit e3e28d1

Browse files
authored
Build binaries statically (#786)
This lets them run in the Alpine-based containers used in the CI/CD templates.
1 parent f71d421 commit e3e28d1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

build/build-include.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ function build_binaries() {
5454
bin_name="$(basename ${build_dir})"
5555
bin="${bin_name}_${VERSION}_${OS}-${ARCH}"
5656
echo "Building ${OUTPUT_DIR}/${bin}"
57-
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}"
57+
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}"
5858
done
5959
done
6060
done

0 commit comments

Comments
 (0)