From 2566baa198f27642971bb6daf7cdefd0b070fef6 Mon Sep 17 00:00:00 2001 From: "Giau. Tran Minh" <12751435+giautm@users.noreply.github.com> Date: Thu, 3 Oct 2024 18:54:11 +0700 Subject: [PATCH] chore: ensure build docker image with latest atlas (#196) --- Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index f90a76c..72184ff 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,5 @@ +ATLAS_VERSION=$(shell curl -s https://release.ariga.io/atlas/atlas-linux-amd64-latest.version) + # Image URL to use all building/pushing image targets IMG ?= controller:latest KIND_CLUSTER ?= kind @@ -115,7 +117,7 @@ run: manifests generate fmt vet ## Run a controller from your host. # More info: https://docs.docker.com/develop/develop-images/build_enhancements/ .PHONY: docker-build docker-build: ## Build docker image with the manager. - $(CONTAINER_TOOL) build -t ${IMG} . + $(CONTAINER_TOOL) build --build-arg ATLAS_VERSION=${ATLAS_VERSION} -t ${IMG} . .PHONY: docker-push docker-push: ## Push docker image with the manager. @@ -134,7 +136,7 @@ docker-buildx: ## Build and push docker image for the manager for cross-platform sed -e '1 s/\(^FROM\)/FROM --platform=\$$\{BUILDPLATFORM\}/; t' -e ' 1,// s//FROM --platform=\$$\{BUILDPLATFORM\}/' Dockerfile > Dockerfile.cross - $(CONTAINER_TOOL) buildx create --name project-v4-builder $(CONTAINER_TOOL) buildx use project-v4-builder - - $(CONTAINER_TOOL) buildx build --push --platform=$(PLATFORMS) --tag ${IMG} -f Dockerfile.cross . + - $(CONTAINER_TOOL) buildx build --push --platform=$(PLATFORMS) --build-arg ATLAS_VERSION=${ATLAS_VERSION} --tag ${IMG} -f Dockerfile.cross . - $(CONTAINER_TOOL) buildx rm project-v4-builder rm Dockerfile.cross