From ef4c8c9cfdf0c94336c900bd27bd495f62db4c73 Mon Sep 17 00:00:00 2001 From: Jared Watts Date: Mon, 8 Sep 2025 08:10:44 -0700 Subject: [PATCH 1/2] build: fixes for make build and make publish after migrating to imagelight.mk - implement img.publish target, using docker buildx and BUILD_ARGS="--push" - set REGISTRY_ORGS variable to docker.io/crossplane - explicitly set tag for index.docker.io/crossplane/conformance-testdata-configuration:latest Signed-off-by: Jared Watts --- .github/workflows/ci.yml | 2 +- Makefile | 2 +- cluster/images/conformance/Makefile | 25 +++++++++++++++++++------ 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3ec60f3..53d4741 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -310,4 +310,4 @@ jobs: - name: Push Latest if: env.DOCKER_USR != '' - run: ./crossplane xpkg push -f conformance.xpkg index.docker.io/crossplane/conformance-testdata-configuration + run: ./crossplane xpkg push -f conformance.xpkg index.docker.io/crossplane/conformance-testdata-configuration:latest diff --git a/Makefile b/Makefile index 8cb5ba2..8a941c6 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ GOLANGCILINT_VERSION = 2.2.2 -include build/makelib/golang.mk # Setup Images -DOCKER_REGISTRY = crossplane +REGISTRY_ORGS ?= docker.io/crossplane IMAGES = conformance OSBASEIMAGE = gcr.io/distroless/static:nonroot -include build/makelib/imagelight.mk diff --git a/cluster/images/conformance/Makefile b/cluster/images/conformance/Makefile index 9539dd5..d3e0234 100755 --- a/cluster/images/conformance/Makefile +++ b/cluster/images/conformance/Makefile @@ -9,19 +9,32 @@ IMAGE = $(BUILD_REGISTRY)/conformance-$(ARCH) OSBASEIMAGE = gcr.io/distroless/static@sha256:aea3063d00e3969d57cc8903709b58c8ee813576fbba56a977eeb915515e4ff0 include ../../../build/makelib/imagelight.mk -ifeq ($(PLATFORM),$(filter $(PLATFORM),darwin_amd64 windows_amd64)) +ifeq ($(PLATFORM),$(filter $(PLATFORM),darwin_amd64 darwin_arm64 windows_amd64)) $(info Skipping image build for $(PLATFORM)) img.build: else img.build: @$(INFO) docker build $(IMAGE) + @$(MAKE) BUILD_ARGS="--load" img.build.shared + @$(OK) docker build $(IMAGE) +endif + +ifeq ($(PLATFORM),$(filter $(PLATFORM),darwin_amd64 darwin_arm64 windows_amd64)) +$(info Skipping image publish for $(PLATFORM)) +img.publish: +else +img.publish: + @$(INFO) docker publish $(IMAGE) + @$(MAKE) BUILD_ARGS="--push" img.build.shared + @$(OK) docker publish $(IMAGE) +endif + +img.build.shared: @cp Dockerfile $(IMAGE_TEMP_DIR) || $(FAIL) - @cp $(OUTPUT_DIR)/tests/$(OS)_$(ARCH)/tests $(IMAGE_TEMP_DIR)/conformance || $(FAIL) + @cp $(OUTPUT_DIR)/tests/linux_$(ARCH)/tests $(IMAGE_TEMP_DIR)/conformance || $(FAIL) @cp ../../../run.sh $(IMAGE_TEMP_DIR) || $(FAIL) @cd $(IMAGE_TEMP_DIR) && $(SED_CMD) 's|BASEIMAGE|$(OSBASEIMAGE)|g' Dockerfile || $(FAIL) - @docker build $(BUILD_ARGS) \ + @docker buildx build $(BUILD_ARGS) \ --platform linux/$(ARCH) \ -t $(IMAGE) \ - $(IMAGE_TEMP_DIR) || $(FAIL) - @$(OK) docker build $(IMAGE) -endif + $(IMAGE_TEMP_DIR) || $(FAIL) \ No newline at end of file From 270674eb6d59b62f5fd237d3c0b6fcf0418206df Mon Sep 17 00:00:00 2001 From: Jared Watts Date: Mon, 8 Sep 2025 12:25:37 -0700 Subject: [PATCH 2/2] build: update OS base image to latest distroless/static-debian12 Signed-off-by: Jared Watts --- Makefile | 2 +- cluster/images/conformance/Makefile | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 8a941c6..6afc419 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,7 @@ GOLANGCILINT_VERSION = 2.2.2 # Setup Images REGISTRY_ORGS ?= docker.io/crossplane IMAGES = conformance -OSBASEIMAGE = gcr.io/distroless/static:nonroot +OSBASEIMAGE = gcr.io/distroless/static-debian12:nonroot -include build/makelib/imagelight.mk fallthrough: submodules diff --git a/cluster/images/conformance/Makefile b/cluster/images/conformance/Makefile index d3e0234..a1c2414 100755 --- a/cluster/images/conformance/Makefile +++ b/cluster/images/conformance/Makefile @@ -3,10 +3,11 @@ include ../../../build/makelib/common.mk IMAGE = $(BUILD_REGISTRY)/conformance-$(ARCH) -# Note that this is actually the 'debug' variant of the static image, which -# includes a busybox shell with just enough functionality to turn regular old -# Go test output into the gzipped tarball of junit XML that Sonobuoy craves. -OSBASEIMAGE = gcr.io/distroless/static@sha256:aea3063d00e3969d57cc8903709b58c8ee813576fbba56a977eeb915515e4ff0 +# Note that this is actually the 'debug-nonroot' variant of the static-debian12 +# image, which includes a busybox shell with just enough functionality to turn +# regular old Go test output into the gzipped tarball of junit XML that Sonobuoy +# craves. +OSBASEIMAGE = gcr.io/distroless/static-debian12@sha256:f556e84ce8fb32fdd5a4478550b720330a22f13ff52dab68d7a7bb3a4266829d include ../../../build/makelib/imagelight.mk ifeq ($(PLATFORM),$(filter $(PLATFORM),darwin_amd64 darwin_arm64 windows_amd64))