Skip to content

Commit e543f46

Browse files
committed
Use the Linux build for Docker image
1 parent dbd0f8f commit e543f46

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ GIT_TAG?= $(shell git describe --always --tags)
22
BIN = gosec
33
FMT_CMD = $(gofmt -s -l -w $(find . -type f -name '*.go' -not -path './vendor/*') | tee /dev/stderr)
44
IMAGE_REPO = docker.io
5+
BUILDFLAGS := ''
6+
CGO_ENABLED = 0
57

68
default:
79
$(MAKE) bootstrap
@@ -27,8 +29,11 @@ clean:
2729
release: bootstrap
2830
@echo "Releasing the gosec binary..."
2931
goreleaser release
32+
33+
build-linux:
34+
CGO_ENABLED=$(CGO_ENABLED) GOOS=linux GOARCH=amd64 go build -ldflags $(BUILDFLAGS) -o $(BIN) ./cmd/gosec/
3035

31-
image: build
36+
image: build-linux
3237
@echo "Building the Docker image..."
3338
docker build -t $(IMAGE_REPO)/$(BIN):$(GIT_TAG) .
3439
docker tag $(IMAGE_REPO)/$(BIN):$(GIT_TAG) $(IMAGE_REPO)/$(BIN):latest

0 commit comments

Comments
 (0)