Skip to content

Commit 83b2517

Browse files
committed
NVHSAS-6217: Build binary with build container
1 parent 032db34 commit 83b2517

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

Makefile

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,12 @@
1-
deployment:
2-
env GOOS=linux GOARCH=amd64 go build .
1+
.PHONY:
2+
3+
BASE_IMAGE_TAG = latest
4+
BUILD_IMAGE_TAG = v1
5+
6+
all:
7+
env GOOS=linux GOARCH=amd64 go build -ldflags='-s -w' -buildvcs=false .
8+
9+
binary:
10+
@echo "Making $@ ..."
11+
@docker pull neuvector/build_fleet:${BUILD_IMAGE_TAG}
12+
@docker run --rm -ia STDOUT --name build --net=none -v $(CURDIR):/go/src/github.com/neuvector/sigstore-interface -w /go/src/github.com/neuvector/sigstore-interface --entrypoint ./make_bin.sh neuvector/build_fleet:${BUILD_IMAGE_TAG}

make_bin.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
# This script is invoked by build container
4+
5+
./unitest.sh || exit $?
6+
7+
echo "==> Making binary"
8+
make || exit $?

unitest.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
go test ./... || exit $?

0 commit comments

Comments
 (0)