From ae32180df39a110725384ac22a8b2453ec902dbf Mon Sep 17 00:00:00 2001 From: Gabriel Saratura Date: Tue, 6 Jun 2023 14:09:50 +0200 Subject: [PATCH] Update docker build make target --- Makefile | 4 +++- Makefile.vars.mk | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c365c11..3cb0f29 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,9 @@ build-bin: fmt vet ## Build binary @go build -o $(BIN_FILENAME) . .PHONY: build-docker -build-docker: build-bin ## Build docker image +build-docker: ## Build docker image + env CGO_ENABLED=0 GOOS=$(DOCKER_IMAGE_GOOS) GOARCH=$(DOCKER_IMAGE_GOARCH) \ + go build -o ${BIN_FILENAME} $(DOCKER_CMD) build -t $(CONTAINER_IMG) . .PHONY: docs-serve diff --git a/Makefile.vars.mk b/Makefile.vars.mk index 2d872d4..05882bc 100644 --- a/Makefile.vars.mk +++ b/Makefile.vars.mk @@ -25,3 +25,6 @@ ANTORA_PREVIEW_CMD ?= $(DOCKER_CMD) run --rm --publish 35729:35729 --publish 202 ENVTEST_ADDITIONAL_FLAGS ?= --bin-dir "$(go_bin)" # See https://storage.googleapis.com/kubebuilder-tools/ for list of supported K8s versions ENVTEST_K8S_VERSION = 1.24.x + +DOCKER_IMAGE_GOOS = linux +DOCKER_IMAGE_GOARCH = amd64