From cb8a67cdd0c98f30a29652bbe0bdf1c954ad8a7b Mon Sep 17 00:00:00 2001 From: Doctor Vince Date: Mon, 4 Nov 2024 14:40:34 -0500 Subject: [PATCH] be specific about the platform --- Makefile | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 83350f8..d14b49e 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ REPO := "https://github.com/metal-toolbox/bioscfg.git" .DEFAULT_GOAL := help ## lint -lint: gen-mock +lint: golangci-lint run --config .golangci.yml --fix ## Go test @@ -27,19 +27,6 @@ gen-mock: go generate ./... go mod tidy -## build-osx -build-osx: -ifeq ($(GO_VERSION), 0) - $(error build requies go version 1.22 or higher) -endif - CGO_ENABLED=0 go build -o bioscfg \ - -ldflags \ - "-X $(LDFLAG_LOCATION).GitCommit=$(GIT_COMMIT) \ - -X $(LDFLAG_LOCATION).GitBranch=$(GIT_BRANCH) \ - -X $(LDFLAG_LOCATION).GitSummary=$(GIT_SUMMARY) \ - -X $(LDFLAG_LOCATION).AppVersion=$(VERSION) \ - -X $(LDFLAG_LOCATION).BuildDate=$(BUILD_DATE)" - ## Build linux bin build-linux: ifeq ($(GO_VERSION), 0) @@ -56,7 +43,7 @@ endif ## build docker image and tag as ghcr.io/metal-toolbox/bioscfg:latest build-image: build-linux @echo ">>>> NOTE: You may want to execute 'make build-image-nocache' depending on the Docker stages changed" - docker build --rm=true -f Dockerfile -t ${DOCKER_IMAGE}:latest . \ + docker buildx build --platform linux/amd64 --rm=true -f Dockerfile -t ${DOCKER_IMAGE}:latest . \ --label org.label-schema.schema-version=1.0 \ --label org.label-schema.vcs-ref=$(GIT_COMMIT_FULL) \ --label org.label-schema.vcs-url=$(REPO)