From afeb1622245e319b66ec6d2bab67eac77859dc4e Mon Sep 17 00:00:00 2001 From: "Christian M. Adams" Date: Mon, 8 Jan 2024 12:00:39 -0500 Subject: [PATCH] Remove broken work-around for specifying build platforms for the operator image Signed-off-by: Christian M. Adams --- .../ansible/v1/scaffolds/internal/templates/makefile.go | 7 ++----- testdata/memcached-molecule-operator/Makefile | 7 ++----- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/pkg/plugins/ansible/v1/scaffolds/internal/templates/makefile.go b/pkg/plugins/ansible/v1/scaffolds/internal/templates/makefile.go index 07ffb2a..870c7be 100644 --- a/pkg/plugins/ansible/v1/scaffolds/internal/templates/makefile.go +++ b/pkg/plugins/ansible/v1/scaffolds/internal/templates/makefile.go @@ -111,14 +111,11 @@ docker-push: ## Push docker image with the manager. # To properly provided solutions that supports more than one platform you should use this option. PLATFORMS ?= linux/arm64,linux/amd64,linux/s390x,linux/ppc64le .PHONY: docker-buildx -docker-buildx: test ## Build and push docker image for the manager for cross-platform support - # copy existing Dockerfile and insert --platform=${BUILDPLATFORM} into Dockerfile.cross, and preserve the original Dockerfile - sed -e '1 s/\(^FROM\)/FROM --platform=\$$\{BUILDPLATFORM\}/; t' -e ' 1,// s//FROM --platform=\$$\{BUILDPLATFORM\}/' Dockerfile > Dockerfile.cross +docker-buildx: ## Build and push docker image for the manager for cross-platform support - docker buildx create --name project-v3-builder docker buildx use project-v3-builder - - docker buildx build --push --platform=$(PLATFORMS) --tag ${IMG} -f Dockerfile.cross . + - docker buildx build --push --platform=$(PLATFORMS) --tag ${IMG} -f Dockerfile . - docker buildx rm project-v3-builder - rm Dockerfile.cross ##@ Deployment diff --git a/testdata/memcached-molecule-operator/Makefile b/testdata/memcached-molecule-operator/Makefile index e87f470..ea4dedd 100644 --- a/testdata/memcached-molecule-operator/Makefile +++ b/testdata/memcached-molecule-operator/Makefile @@ -45,14 +45,11 @@ docker-push: ## Push docker image with the manager. # To properly provided solutions that supports more than one platform you should use this option. PLATFORMS ?= linux/arm64,linux/amd64,linux/s390x,linux/ppc64le .PHONY: docker-buildx -docker-buildx: test ## Build and push docker image for the manager for cross-platform support - # copy existing Dockerfile and insert --platform=${BUILDPLATFORM} into Dockerfile.cross, and preserve the original Dockerfile - sed -e '1 s/\(^FROM\)/FROM --platform=\$$\{BUILDPLATFORM\}/; t' -e ' 1,// s//FROM --platform=\$$\{BUILDPLATFORM\}/' Dockerfile > Dockerfile.cross +docker-buildx: ## Build and push docker image for the manager for cross-platform support - docker buildx create --name project-v3-builder docker buildx use project-v3-builder - - docker buildx build --push --platform=$(PLATFORMS) --tag ${IMG} -f Dockerfile.cross . + - docker buildx build --push --platform=$(PLATFORMS) --tag ${IMG} -f Dockerfile . - docker buildx rm project-v3-builder - rm Dockerfile.cross ##@ Deployment