Use the Linux build for Docker image

This commit is contained in:
Cosmin Cojocar 2018-08-15 09:53:33 +02:00
parent dbd0f8f511
commit e543f4662c

View file

@ -2,6 +2,8 @@ GIT_TAG?= $(shell git describe --always --tags)
BIN = gosec
FMT_CMD = $(gofmt -s -l -w $(find . -type f -name '*.go' -not -path './vendor/*') | tee /dev/stderr)
IMAGE_REPO = docker.io
BUILDFLAGS := ''
CGO_ENABLED = 0
default:
$(MAKE) bootstrap
@ -28,7 +30,10 @@ release: bootstrap
@echo "Releasing the gosec binary..."
goreleaser release
image: build
build-linux:
CGO_ENABLED=$(CGO_ENABLED) GOOS=linux GOARCH=amd64 go build -ldflags $(BUILDFLAGS) -o $(BIN) ./cmd/gosec/
image: build-linux
@echo "Building the Docker image..."
docker build -t $(IMAGE_REPO)/$(BIN):$(GIT_TAG) .
docker tag $(IMAGE_REPO)/$(BIN):$(GIT_TAG) $(IMAGE_REPO)/$(BIN):latest