From e1f21c939bb0469297e6d02dc3de466c80a6e03c Mon Sep 17 00:00:00 2001 From: "Sam Wang (holyspectral)" Date: Fri, 1 Nov 2024 15:39:53 -0400 Subject: [PATCH] feat: NVSHAS-9502 create standalone Dockerfile 1. Provide cross platform/standalone Dockerfile 2. Release.yml to publish SLSA-capable artifacts 3. Provide build target, test-image, build-image and push-image to sync with rancher. 4. Upgrade to BCI 15.6 --- .github/workflows/release.yml | 2 ++ Makefile | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3dc1e8a..86e10d5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -38,6 +38,7 @@ jobs: with: push-to-public: true push-to-prime: false + make-target: push-image image: prometheus-exporter tag: ${{ env.TAG }} platforms: linux/amd64,linux/arm64 @@ -51,6 +52,7 @@ jobs: with: push-to-public: false push-to-prime: true + make-target: push-rancher-image image: neuvector-prometheus-exporter tag: ${{ env.TAG }} platforms: linux/amd64,linux/arm64 diff --git a/Makefile b/Makefile index 37ae5fa..1140c7b 100644 --- a/Makefile +++ b/Makefile @@ -61,6 +61,12 @@ build-image: buildx-machine ## build (and load) the container image targeting th push-image: buildx-machine + $(IMAGE_BUILDER) build -f package/Dockerfile \ + --builder $(MACHINE) $(IMAGE_ARGS) $(IID_FILE_FLAG) $(BUILDX_ARGS) \ + --build-arg VERSION=$(VERSION) --build-arg COMMIT=$(COMMIT) --platform=$(TARGET_PLATFORMS) -t "$(REPO)/prometheus-exporter:$(TAG)" --push . + @echo "Pushed $(IMAGE)" + +push-rancher-image: buildx-machine $(IMAGE_BUILDER) build -f package/Dockerfile \ --builder $(MACHINE) $(IMAGE_ARGS) $(IID_FILE_FLAG) $(BUILDX_ARGS) \ --build-arg VERSION=$(VERSION) --build-arg COMMIT=$(COMMIT) --platform=$(TARGET_PLATFORMS) -t "$(REPO)/neuvector-prometheus-exporter:$(TAG)" --push .