From dce8734c6dfd803abe59b9c4e7a16816e21b3c95 Mon Sep 17 00:00:00 2001 From: aahel Date: Fri, 23 Feb 2024 00:05:26 +0530 Subject: [PATCH] added buildx --- .github/workflows/terraform-ci.yml | 2 ++ consul-lambda/Makefile | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/terraform-ci.yml b/.github/workflows/terraform-ci.yml index f1b68ef..e2e2a31 100644 --- a/.github/workflows/terraform-ci.yml +++ b/.github/workflows/terraform-ci.yml @@ -87,6 +87,8 @@ jobs: with: go-version: ${{ needs.get-go-version.outputs.go-version }} cache-dependency-path: ./test/acceptance/go.sum + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@2a1a44ac4aa01993040736bd95bb470da1a38365 # v2.9.0 - name: Setup gotestsum shell: bash run: | diff --git a/consul-lambda/Makefile b/consul-lambda/Makefile index 497dff3..90ce761 100644 --- a/consul-lambda/Makefile +++ b/consul-lambda/Makefile @@ -34,14 +34,14 @@ dev: dist # So we enable build-kit in the individual targets. # We can set this here one time, once we're off CircleCI. # export DOCKER_BUILDKIT=1 -BUILD_ARGS = BIN_NAME=consul-lambda-registrator VERSION=$(VERSION) GIT_COMMIT=$(GIT_COMMIT) GIT_DIRTY=$(GIT_DIRTY) ARCH=$(ARCH) +BUILD_ARGS = BIN_NAME=consul-lambda-registrator VERSION=$(VERSION) GIT_COMMIT=$(GIT_COMMIT) GIT_DIRTY=$(GIT_DIRTY) TAG ?= $(BIN_NAME)/$(TARGET):$(VERSION) BA_FLAGS = $(addprefix --build-arg=,$(BUILD_ARGS)) -FLAGS = --target $(TARGET) --platform $(PLATFORM) --tag $(TAG) $(BA_FLAGS) +FLAGS = --load --platform $(PLATFORM) --tag $(TAG) $(BA_FLAGS) # Set OS to linux for all docker/* targets. docker: OS = linux docker: TARGET = release-default docker: dev # TODO - export DOCKER_BUILDKIT=1; docker build $(FLAGS) ./consul-lambda-registrator + docker buildx use default && docker buildx build $(FLAGS) ./consul-lambda-registrator .PHONY: docker