From 6695e6b625a78ca3db16380a4fefc6806f5ddc80 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Sat, 14 Jan 2023 15:19:47 +0100 Subject: [PATCH] add goarm handling in makefile (#176) --- Dockerfile.multiarch | 1 - Makefile | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile.multiarch b/Dockerfile.multiarch index 19027ba..b212e7d 100644 --- a/Dockerfile.multiarch +++ b/Dockerfile.multiarch @@ -37,5 +37,4 @@ RUN apk --update add --virtual .build-deps curl && \ rm -rf /tmp/* COPY --from=build /src/dist/drone-docker-buildx /bin/drone-docker-buildx - ENTRYPOINT ["/usr/local/bin/dockerd-entrypoint.sh", "drone-docker-buildx"] diff --git a/Makefile b/Makefile index bdd477c..2f1744d 100644 --- a/Makefile +++ b/Makefile @@ -24,6 +24,9 @@ XGO_TARGETS ?= linux/amd64,linux/arm64 TARGETOS ?= linux TARGETARCH ?= amd64 +ifneq ("$(TARGETVARIANT)","") +GOARM ?= $(subst v,,$(TARGETVARIANT)) +endif TAGS ?= netgo ifndef VERSION @@ -71,7 +74,7 @@ test: build: $(DIST)/$(EXECUTABLE) $(DIST)/$(EXECUTABLE): $(SOURCES) - GOOS=${TARGETOS} GOARCH=${TARGETARCH} $(GO) build -v -tags '$(TAGS)' -ldflags '-extldflags "-static" $(LDFLAGS)' -o $@ ./cmd/$(EXECUTABLE) + GOOS=${TARGETOS} GOARCH=${TARGETARCH} GOARM=$(GOARM) $(GO) build -v -tags '$(TAGS)' -ldflags '-extldflags "-static" $(LDFLAGS)' -o $@ ./cmd/$(EXECUTABLE) $(DIST_DIRS): mkdir -p $(DIST_DIRS)