diff --git a/packages/apps/clickhouse/Makefile b/packages/apps/clickhouse/Makefile index 0724f170..f1a0e443 100644 --- a/packages/apps/clickhouse/Makefile +++ b/packages/apps/clickhouse/Makefile @@ -8,16 +8,11 @@ generate: image: docker buildx build images/clickhouse-backup \ - --provenance false \ - --builder=$(BUILDER) \ - --platform=$(PLATFORM) \ --tag $(REGISTRY)/clickhouse-backup:$(call settag,$(CLICKHOUSE_BACKUP_TAG)) \ --cache-from type=registry,ref=$(REGISTRY)/clickhouse-backup:latest \ --cache-to type=inline \ --metadata-file images/clickhouse-backup.json \ - --push=$(PUSH) \ - --label "org.opencontainers.image.source=https://github.com/cozystack/cozystack" \ - --load=$(LOAD) + $(BUILDX_ARGS) echo "$(REGISTRY)/clickhouse-backup:$(call settag,$(CLICKHOUSE_BACKUP_TAG))@$$(yq e '."containerimage.digest"' images/clickhouse-backup.json -o json -r)" \ > images/clickhouse-backup.tag rm -f images/clickhouse-backup.json diff --git a/packages/apps/http-cache/Makefile b/packages/apps/http-cache/Makefile index 802df1f2..91a170a5 100644 --- a/packages/apps/http-cache/Makefile +++ b/packages/apps/http-cache/Makefile @@ -7,16 +7,11 @@ image: image-nginx image-nginx: docker buildx build images/nginx-cache \ - --provenance false \ - --builder=$(BUILDER) \ - --platform=$(PLATFORM) \ --tag $(REGISTRY)/nginx-cache:$(call settag,$(NGINX_CACHE_TAG)) \ --cache-from type=registry,ref=$(REGISTRY)/nginx-cache:latest \ --cache-to type=inline \ --metadata-file images/nginx-cache.json \ - --push=$(PUSH) \ - --label "org.opencontainers.image.source=https://github.com/cozystack/cozystack" \ - --load=$(LOAD) + $(BUILDX_ARGS) echo "$(REGISTRY)/nginx-cache:$(call settag,$(NGINX_CACHE_TAG))@$$(yq e '."containerimage.digest"' images/nginx-cache.json -o json -r)" \ > images/nginx-cache.tag rm -f images/nginx-cache.json diff --git a/packages/apps/kubernetes/Makefile b/packages/apps/kubernetes/Makefile index 437487f9..81520296 100644 --- a/packages/apps/kubernetes/Makefile +++ b/packages/apps/kubernetes/Makefile @@ -12,52 +12,37 @@ image: image-ubuntu-container-disk image-kubevirt-cloud-provider image-kubevirt- image-ubuntu-container-disk: docker buildx build images/ubuntu-container-disk \ - --provenance false \ - --builder=$(BUILDER) \ - --platform=$(PLATFORM) \ --build-arg KUBERNETES_VERSION=${KUBERNETES_VERSION} \ --tag $(REGISTRY)/ubuntu-container-disk:$(call settag,$(KUBERNETES_VERSION)) \ --tag $(REGISTRY)/ubuntu-container-disk:$(call settag,$(KUBERNETES_VERSION)-$(TAG)) \ --cache-from type=registry,ref=$(REGISTRY)/ubuntu-container-disk:latest \ --cache-to type=inline \ --metadata-file images/ubuntu-container-disk.json \ - --push=$(PUSH) \ - --label "org.opencontainers.image.source=https://github.com/cozystack/cozystack" \ - --load=$(LOAD) + $(BUILDX_ARGS) echo "$(REGISTRY)/ubuntu-container-disk:$(call settag,$(KUBERNETES_VERSION))@$$(yq e '."containerimage.digest"' images/ubuntu-container-disk.json -o json -r)" \ > images/ubuntu-container-disk.tag rm -f images/ubuntu-container-disk.json image-kubevirt-cloud-provider: docker buildx build images/kubevirt-cloud-provider \ - --provenance false \ - --builder=$(BUILDER) \ - --platform=$(PLATFORM) \ --tag $(REGISTRY)/kubevirt-cloud-provider:$(call settag,$(KUBERNETES_PKG_TAG)) \ --tag $(REGISTRY)/kubevirt-cloud-provider:$(call settag,$(KUBERNETES_PKG_TAG)-$(TAG)) \ --cache-from type=registry,ref=$(REGISTRY)/kubevirt-cloud-provider:latest \ --cache-to type=inline \ --metadata-file images/kubevirt-cloud-provider.json \ - --push=$(PUSH) \ - --label "org.opencontainers.image.source=https://github.com/cozystack/cozystack" \ - --load=$(LOAD) + $(BUILDX_ARGS) echo "$(REGISTRY)/kubevirt-cloud-provider:$(call settag,$(KUBERNETES_PKG_TAG))@$$(yq e '."containerimage.digest"' images/kubevirt-cloud-provider.json -o json -r)" \ > images/kubevirt-cloud-provider.tag rm -f images/kubevirt-cloud-provider.json image-kubevirt-csi-driver: docker buildx build images/kubevirt-csi-driver \ - --provenance false \ - --builder=$(BUILDER) \ - --platform=$(PLATFORM) \ --tag $(REGISTRY)/kubevirt-csi-driver:$(call settag,$(KUBERNETES_PKG_TAG)) \ --tag $(REGISTRY)/kubevirt-csi-driver:$(call settag,$(KUBERNETES_PKG_TAG)-$(TAG)) \ --cache-from type=registry,ref=$(REGISTRY)/kubevirt-csi-driver:latest \ --cache-to type=inline \ --metadata-file images/kubevirt-csi-driver.json \ - --push=$(PUSH) \ - --label "org.opencontainers.image.source=https://github.com/cozystack/cozystack" \ - --load=$(LOAD) + $(BUILDX_ARGS) echo "$(REGISTRY)/kubevirt-csi-driver:$(call settag,$(KUBERNETES_PKG_TAG))@$$(yq e '."containerimage.digest"' images/kubevirt-csi-driver.json -o json -r)" \ > images/kubevirt-csi-driver.tag IMAGE=$$(cat images/kubevirt-csi-driver.tag) \ @@ -67,17 +52,12 @@ image-kubevirt-csi-driver: image-cluster-autoscaler: docker buildx build images/cluster-autoscaler \ - --provenance false \ - --builder=$(BUILDER) \ - --platform=$(PLATFORM) \ --tag $(REGISTRY)/cluster-autoscaler:$(call settag,$(KUBERNETES_PKG_TAG)) \ --tag $(REGISTRY)/cluster-autoscaler:$(call settag,$(KUBERNETES_PKG_TAG)-$(TAG)) \ --cache-from type=registry,ref=$(REGISTRY)/cluster-autoscaler:latest \ --cache-to type=inline \ --metadata-file images/cluster-autoscaler.json \ - --push=$(PUSH) \ - --label "org.opencontainers.image.source=https://github.com/cozystack/cozystack" \ - --load=$(LOAD) + $(BUILDX_ARGS) echo "$(REGISTRY)/cluster-autoscaler:$(call settag,$(KUBERNETES_PKG_TAG))@$$(yq e '."containerimage.digest"' images/cluster-autoscaler.json -o json -r)" \ > images/cluster-autoscaler.tag rm -f images/cluster-autoscaler.json diff --git a/packages/apps/mysql/Makefile b/packages/apps/mysql/Makefile index bbc85d1f..d0576060 100644 --- a/packages/apps/mysql/Makefile +++ b/packages/apps/mysql/Makefile @@ -8,16 +8,11 @@ generate: image: docker buildx build images/mariadb-backup \ - --provenance false \ - --builder=$(BUILDER) \ - --platform=$(PLATFORM) \ --tag $(REGISTRY)/mariadb-backup:$(call settag,$(MARIADB_BACKUP_TAG)) \ --cache-from type=registry,ref=$(REGISTRY)/mariadb-backup:latest \ --cache-to type=inline \ --metadata-file images/mariadb-backup.json \ - --push=$(PUSH) \ - --label "org.opencontainers.image.source=https://github.com/cozystack/cozystack" \ - --load=$(LOAD) + $(BUILDX_ARGS) echo "$(REGISTRY)/mariadb-backup:$(call settag,$(MARIADB_BACKUP_TAG))@$$(yq e '."containerimage.digest"' images/mariadb-backup.json -o json -r)" \ > images/mariadb-backup.tag rm -f images/mariadb-backup.json diff --git a/packages/core/installer/Makefile b/packages/core/installer/Makefile index 6a694e03..a51e7b61 100644 --- a/packages/core/installer/Makefile +++ b/packages/core/installer/Makefile @@ -24,15 +24,11 @@ image: pre-checks image-matchbox image-cozystack image-talos image-cozystack: docker buildx build -f images/cozystack/Dockerfile ../../.. \ - --provenance false \ --tag $(REGISTRY)/installer:$(call settag,$(TAG)) \ --cache-from type=registry,ref=$(REGISTRY)/installer:latest \ - --platform linux/amd64 \ --cache-to type=inline \ --metadata-file images/installer.json \ - --push=$(PUSH) \ - --label "org.opencontainers.image.source=https://github.com/cozystack/cozystack" \ - --load=$(LOAD) + $(BUILDX_ARGS) IMAGE="$(REGISTRY)/installer:$(call settag,$(TAG))@$$(yq e '."containerimage.digest"' images/installer.json -o json -r)" \ yq -i '.cozystack.image = strenv(IMAGE)' values.yaml rm -f images/installer.json @@ -45,15 +41,12 @@ image-matchbox: test -f ../../../_out/assets/kernel-amd64 || make talos-kernel test -f ../../../_out/assets/initramfs-metal-amd64.xz || make talos-initramfs docker buildx build -f images/matchbox/Dockerfile ../../.. \ - --provenance false \ --tag $(REGISTRY)/matchbox:$(call settag,$(TAG)) \ --tag $(REGISTRY)/matchbox:$(call settag,$(TALOS_VERSION)-$(TAG)) \ --cache-from type=registry,ref=$(REGISTRY)/matchbox:latest \ --cache-to type=inline \ --metadata-file images/matchbox.json \ - --push=$(PUSH) \ - --label "org.opencontainers.image.source=https://github.com/cozystack/cozystack" \ - --load=$(LOAD) + $(BUILDX_ARGS) echo "$(REGISTRY)/matchbox:$(call settag,$(TAG))@$$(yq e '."containerimage.digest"' images/matchbox.json -o json -r)" \ > ../../extra/bootbox/images/matchbox.tag rm -f images/matchbox.json diff --git a/packages/core/testing/Makefile b/packages/core/testing/Makefile index 1e7fea3c..f345d155 100755 --- a/packages/core/testing/Makefile +++ b/packages/core/testing/Makefile @@ -16,16 +16,11 @@ image: image-e2e-sandbox image-e2e-sandbox: docker buildx build -f images/e2e-sandbox/Dockerfile images/e2e-sandbox \ - --provenance false \ - --builder=$(BUILDER) \ - --platform=$(PLATFORM) \ --tag $(REGISTRY)/e2e-sandbox:$(call settag,$(TAG)) \ --cache-from type=registry,ref=$(REGISTRY)/e2e-sandbox:latest \ --cache-to type=inline \ --metadata-file images/e2e-sandbox.json \ - --push=$(PUSH) \ - --label "org.opencontainers.image.source=https://github.com/cozystack/cozystack" \ - --load=$(LOAD) + $(BUILDX_ARGS) IMAGE="$(REGISTRY)/e2e-sandbox:$(call settag,$(TAG))@$$(yq e '."containerimage.digest"' images/e2e-sandbox.json -o json -r)" \ yq -i '.e2e.image = strenv(IMAGE)' values.yaml rm -f images/e2e-sandbox.json diff --git a/packages/extra/monitoring/Makefile b/packages/extra/monitoring/Makefile index 53608e14..5ae09c37 100644 --- a/packages/extra/monitoring/Makefile +++ b/packages/extra/monitoring/Makefile @@ -10,16 +10,11 @@ generate: image: docker buildx build images/grafana \ - --provenance false \ - --builder=$(BUILDER) \ - --platform=$(PLATFORM) \ --tag $(REGISTRY)/grafana:$(call settag,$(GRAFANA_TAG)) \ --cache-from type=registry,ref=$(REGISTRY)/grafana:latest \ --cache-to type=inline \ --metadata-file images/grafana.json \ - --push=$(PUSH) \ - --label "org.opencontainers.image.source=https://github.com/cozystack/cozystack" \ - --load=$(LOAD) + $(BUILDX_ARGS) echo "$(REGISTRY)/grafana:$(call settag,$(GRAFANA_TAG))@$$(yq e '."containerimage.digest"' images/grafana.json -o json -r)" \ > images/grafana.tag rm -f images/grafana.json diff --git a/packages/system/bucket/Makefile b/packages/system/bucket/Makefile index 1f8d34b2..d555b71c 100644 --- a/packages/system/bucket/Makefile +++ b/packages/system/bucket/Makefile @@ -12,16 +12,11 @@ image: image-s3manager image-s3manager: docker buildx build images/s3manager \ - --provenance false \ - --builder=$(BUILDER) \ - --platform=$(PLATFORM) \ --tag $(REGISTRY)/s3manager:$(call settag,$(S3MANAGER_TAG)) \ --cache-from type=registry,ref=$(REGISTRY)/s3manager:latest \ --cache-to type=inline \ --metadata-file images/s3manager.json \ - --push=$(PUSH) \ - --label "org.opencontainers.image.source=https://github.com/cozystack/cozystack" \ - --load=$(LOAD) + $(BUILDX_ARGS) echo "$(REGISTRY)/s3manager:$(call settag,$(S3MANAGER_TAG))@$$(yq e '."containerimage.digest"' images/s3manager.json -o json -r)" \ > images/s3manager.tag rm -f images/s3manager.json diff --git a/packages/system/cilium/Makefile b/packages/system/cilium/Makefile index 72502d12..269fb285 100644 --- a/packages/system/cilium/Makefile +++ b/packages/system/cilium/Makefile @@ -17,17 +17,12 @@ update: image: docker buildx build images/cilium \ - --provenance false \ - --builder=$(BUILDER) \ - --platform=$(PLATFORM) \ --tag $(REGISTRY)/cilium:$(call settag,$(CILIUM_TAG)) \ --tag $(REGISTRY)/cilium:$(call settag,$(CILIUM_TAG)-$(TAG)) \ --cache-from type=registry,ref=$(REGISTRY)/cilium:latest \ --cache-to type=inline \ --metadata-file images/cilium.json \ - --push=$(PUSH) \ - --label "org.opencontainers.image.source=https://github.com/cozystack/cozystack" \ - --load=$(LOAD) + $(BUILDX_ARGS) REPOSITORY="$(REGISTRY)/cilium" \ yq -i '.cilium.image.repository = strenv(REPOSITORY)' values.yaml TAG=$(call settag,$(CILIUM_TAG)) \ diff --git a/packages/system/cozystack-api/Makefile b/packages/system/cozystack-api/Makefile index 1cd4ef66..d7504d01 100644 --- a/packages/system/cozystack-api/Makefile +++ b/packages/system/cozystack-api/Makefile @@ -8,16 +8,11 @@ image: image-cozystack-api image-cozystack-api: docker buildx build -f images/cozystack-api/Dockerfile ../../.. \ - --provenance false \ - --builder=$(BUILDER) \ - --platform=$(PLATFORM) \ --tag $(REGISTRY)/cozystack-api:$(call settag,$(TAG)) \ --cache-from type=registry,ref=$(REGISTRY)/cozystack-api:latest \ --cache-to type=inline \ --metadata-file images/cozystack-api.json \ - --push=$(PUSH) \ - --label "org.opencontainers.image.source=https://github.com/cozystack/cozystack" \ - --load=$(LOAD) + $(BUILDX_ARGS) IMAGE="$(REGISTRY)/cozystack-api:$(call settag,$(TAG))@$$(yq e '."containerimage.digest"' images/cozystack-api.json -o json -r)" \ yq -i '.cozystackAPI.image = strenv(IMAGE)' values.yaml rm -f images/cozystack-api.json diff --git a/packages/system/cozystack-controller/Makefile b/packages/system/cozystack-controller/Makefile index a75faea9..9bbfb5a6 100644 --- a/packages/system/cozystack-controller/Makefile +++ b/packages/system/cozystack-controller/Makefile @@ -8,16 +8,11 @@ image: image-cozystack-controller update-version image-cozystack-controller: docker buildx build -f images/cozystack-controller/Dockerfile ../../.. \ - --provenance false \ - --builder=$(BUILDER) \ - --platform=$(PLATFORM) \ --tag $(REGISTRY)/cozystack-controller:$(call settag,$(TAG)) \ --cache-from type=registry,ref=$(REGISTRY)/cozystack-controller:latest \ --cache-to type=inline \ --metadata-file images/cozystack-controller.json \ - --push=$(PUSH) \ - --label "org.opencontainers.image.source=https://github.com/cozystack/cozystack" \ - --load=$(LOAD) + $(BUILDX_ARGS) IMAGE="$(REGISTRY)/cozystack-controller:$(call settag,$(TAG))@$$(yq e '."containerimage.digest"' images/cozystack-controller.json -o json -r)" \ yq -i '.cozystackController.image = strenv(IMAGE)' values.yaml rm -f images/cozystack-controller.json diff --git a/packages/system/dashboard/Makefile b/packages/system/dashboard/Makefile index 10df5382..fd83f384 100644 --- a/packages/system/dashboard/Makefile +++ b/packages/system/dashboard/Makefile @@ -28,16 +28,11 @@ update-dockerfiles: image-dashboard: update-version docker buildx build images/dashboard \ - --provenance false \ - --builder=$(BUILDER) \ - --platform=$(PLATFORM) \ --tag $(REGISTRY)/dashboard:$(call settag,$(TAG)) \ --cache-from type=registry,ref=$(REGISTRY)/dashboard:latest \ --cache-to type=inline \ --metadata-file images/dashboard.json \ - --push=$(PUSH) \ - --label "org.opencontainers.image.source=https://github.com/cozystack/cozystack" \ - --load=$(LOAD) + $(BUILDX_ARGS) REGISTRY="$(REGISTRY)" \ yq -i '.kubeapps.dashboard.image.registry = strenv(REGISTRY)' values.yaml REPOSITORY="dashboard" \ @@ -50,16 +45,11 @@ image-dashboard: update-version image-kubeapps-apis: update-version docker buildx build images/kubeapps-apis \ - --provenance false \ - --builder=$(BUILDER) \ - --platform=$(PLATFORM) \ --tag $(REGISTRY)/kubeapps-apis:$(call settag,$(TAG)) \ --cache-from type=registry,ref=$(REGISTRY)/kubeapps-apis:latest \ --cache-to type=inline \ --metadata-file images/kubeapps-apis.json \ - --push=$(PUSH) \ - --label "org.opencontainers.image.source=https://github.com/cozystack/cozystack" \ - --load=$(LOAD) + $(BUILDX_ARGS) REGISTRY="$(REGISTRY)" \ yq -i '.kubeapps.kubeappsapis.image.registry = strenv(REGISTRY)' values.yaml REPOSITORY="kubeapps-apis" \ diff --git a/packages/system/kamaji/Makefile b/packages/system/kamaji/Makefile index 55921018..c24e2d4e 100644 --- a/packages/system/kamaji/Makefile +++ b/packages/system/kamaji/Makefile @@ -13,16 +13,11 @@ update: image: docker buildx build images/kamaji \ - --provenance false \ - --builder=$(BUILDER) \ - --platform=$(PLATFORM) \ --tag $(REGISTRY)/kamaji:$(call settag,$(TAG)) \ --cache-from type=registry,ref=$(REGISTRY)/kamaji:latest \ --cache-to type=inline \ --metadata-file images/kamaji.json \ - --push=$(PUSH) \ - --label "org.opencontainers.image.source=https://github.com/cozystack/cozystack" - --load=$(LOAD) + $(BUILDX_ARGS) REPOSITORY="$(REGISTRY)/kamaji" \ yq -i '.kamaji.image.repository = strenv(REPOSITORY)' values.yaml TAG=$(TAG)@$$(yq e '."containerimage.digest"' images/kamaji.json -o json -r) \ diff --git a/packages/system/kubeovn-webhook/Makefile b/packages/system/kubeovn-webhook/Makefile index 76bf5f5a..9134d55f 100644 --- a/packages/system/kubeovn-webhook/Makefile +++ b/packages/system/kubeovn-webhook/Makefile @@ -6,16 +6,11 @@ include ../../../scripts/package.mk image: docker buildx build images/kubeovn-webhook \ - --provenance false \ - --builder=$(BUILDER) \ - --platform=$(PLATFORM) \ --tag $(REGISTRY)/kubeovn-webhook:$(call settag,$(TAG)) \ --cache-from type=registry,ref=$(REGISTRY)/kubeovn-webhook:latest \ --cache-to type=inline \ --metadata-file images/kubeovn-webhook.json \ - --push=$(PUSH) \ - --label "org.opencontainers.image.source=https://github.com/cozystack/cozystack" - --load=$(LOAD) + $(BUILDX_ARGS) IMAGE="$(REGISTRY)/kubeovn-webhook:$(call settag,$(TAG))@$$(yq e '."containerimage.digest"' images/kubeovn-webhook.json -o json -r)" \ yq -i '.image = strenv(IMAGE)' values.yaml rm -f images/kubeovn-webhook.json diff --git a/packages/system/kubeovn/Makefile b/packages/system/kubeovn/Makefile index 9bbd8578..15373d2f 100644 --- a/packages/system/kubeovn/Makefile +++ b/packages/system/kubeovn/Makefile @@ -19,17 +19,12 @@ update: image: docker buildx build images/kubeovn \ - --provenance false \ - --builder=$(BUILDER) \ - --platform=$(PLATFORM) \ --tag $(REGISTRY)/kubeovn:$(call settag,$(KUBEOVN_TAG)) \ --tag $(REGISTRY)/kubeovn:$(call settag,$(KUBEOVN_TAG)-$(TAG)) \ --cache-from type=registry,ref=$(REGISTRY)/kubeovn:latest \ --cache-to type=inline \ --metadata-file images/kubeovn.json \ - --push=$(PUSH) \ - --label "org.opencontainers.image.source=https://github.com/cozystack/cozystack" \ - --load=$(LOAD) + $(BUILDX_ARGS) REGISTRY="$(REGISTRY)" \ yq -i '.global.registry.address = strenv(REGISTRY)' values.yaml REPOSITORY="kubeovn" \ diff --git a/packages/system/metallb/Makefile b/packages/system/metallb/Makefile index fbc3dfa0..5323f414 100644 --- a/packages/system/metallb/Makefile +++ b/packages/system/metallb/Makefile @@ -15,18 +15,13 @@ image-controller image-speaker: $(eval TARGET := $(subst image-,,$@)) $(eval VERSION := $(shell yq '.appVersion' charts/metallb/Chart.yaml)) docker buildx build images/metallb \ - --provenance false \ - --builder=$(BUILDER) \ - --platform=$(PLATFORM) \ --target $(TARGET) \ --build-arg VERSION=$(VERSION) \ --tag $(REGISTRY)/metallb-$(TARGET):$(VERSION) \ --cache-from type=registry,ref=$(REGISTRY)/metallb-$(TARGET):latest \ --cache-to type=inline \ --metadata-file images/$(TARGET).json \ - --push=$(PUSH) \ - --label "org.opencontainers.image.source=https://github.com/cozystack/cozystack" \ - --load=$(LOAD) + $(BUILDX_ARGS) REPOSITORY="$(REGISTRY)/metallb-$(TARGET)" \ yq -i '.metallb.$(TARGET).image.repository = strenv(REPOSITORY)' values.yaml TAG=$(VERSION)@$$(yq e '."containerimage.digest"' images/$(TARGET).json -o json -r) \ diff --git a/packages/system/objectstorage-controller/Makefile b/packages/system/objectstorage-controller/Makefile index 493646b0..54c195a0 100644 --- a/packages/system/objectstorage-controller/Makefile +++ b/packages/system/objectstorage-controller/Makefile @@ -22,8 +22,7 @@ image-controller image-sidecar: --cache-from type=registry,ref=$(REGISTRY)/objectstorage-$(TARGET):latest \ --cache-to type=inline \ --metadata-file images/$(TARGET).json \ - --push=$(PUSH) --provenance=false --load=$(LOAD) \ - --label "org.opencontainers.image.source=https://github.com/cozystack/cozystack" + $(BUILDX_ARGS) IMAGE="$(REGISTRY)/objectstorage-$(TARGET):$(call settag,$(TAG))@$$(yq e '."containerimage.digest"' images/$(TARGET).json -r)" \ yq -i '$(YAML_PATH) = strenv(IMAGE)' $(VALUES_FILE) rm -f images/$(TARGET).json diff --git a/scripts/common-envs.mk b/scripts/common-envs.mk index ec11ada4..865935ef 100644 --- a/scripts/common-envs.mk +++ b/scripts/common-envs.mk @@ -1,8 +1,17 @@ REGISTRY ?= ghcr.io/cozystack/cozystack +TAG = $(shell git describe --tags --exact-match 2>/dev/null || echo latest) PUSH := 1 LOAD := 0 +BUILDER ?= +PLATFORM ?= +BUILDX_EXTRA_ARGS ?= COZYSTACK_VERSION = $(patsubst v%,%,$(shell git describe --tags)) -TAG = $(shell git describe --tags --exact-match 2>/dev/null || echo latest) + +BUILDX_ARGS := --provenance=false --push=$(PUSH) --load=$(LOAD) \ + --label org.opencontainers.image.source=https://github.com/cozystack/cozystack \ + $(if $(strip $(BUILDER)),--builder=$(BUILDER)) \ + $(if $(strip $(PLATFORM)),--platform=$(PLATFORM)) \ + $(BUILDX_EXTRA_ARGS) # Returns 'latest' if the git tag is not assigned, otherwise returns the provided value define settag @@ -15,10 +24,3 @@ ifeq ($(COZYSTACK_VERSION),) COZYSTACK_VERSION = $(patsubst v%,%,$(shell git describe --tags)) endif -# Get the name of the selected docker buildx builder -BUILDER ?= $(shell docker buildx inspect --bootstrap | head -n2 | awk '/^Name:/{print $$NF}') - -# Get platforms supported by the builder (only if PLATFORM is not provided) -ifeq ($(origin PLATFORM), undefined) -PLATFORM := $(shell docker buildx ls --format=json | jq -r 'select(.Name == "$(BUILDER)") | [.Nodes[].Platforms // []] | flatten | unique | map(select(test("^linux/amd64$$|^linux/arm64$$"))) | join(",")') -endif