From a47b06f937cb6b96fb392d6b4efc193908433074 Mon Sep 17 00:00:00 2001 From: Lucas Benedito Date: Tue, 6 Jan 2026 12:02:11 +0000 Subject: [PATCH] devel: Update development guide - Update the development.md file - Allow builds from macos automatically - implement podman-buildx Signed-off-by: Lucas Benedito --- Dockerfile | 4 ++-- Makefile | 4 ++++ docs/development.md | 2 +- up.sh | 18 +++++++++++++----- 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index b4375e7a..8c2eaa01 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ FROM quay.io/operator-framework/ansible-operator:v1.36.1 USER root -RUN dnf update --security --bugfix -y && \ - dnf install -y openssl +RUN dnf update --security --bugfix -y --disableplugin=subscription-manager && \ + dnf install -y --disableplugin=subscription-manager openssl USER 1001 diff --git a/Makefile b/Makefile index 0281cde9..771c4b90 100644 --- a/Makefile +++ b/Makefile @@ -105,6 +105,10 @@ docker-buildx: ## Build and push docker image for the manager for cross-platform - docker buildx build --push $(BUILD_ARGS) --platform=$(PLATFORMS) --tag ${IMG} -f Dockerfile . - docker buildx rm project-v3-builder +.PHONY: podman-buildx +podman-buildx: ## Build and push podman image for the manager for cross-platform support + podman build --platform=$(PLATFORMS) $(BUILD_ARGS) --manifest ${IMG} -f Dockerfile . + podman manifest push --all ${IMG} ${IMG} ##@ Deployment diff --git a/docs/development.md b/docs/development.md index e434a95e..1510eb06 100644 --- a/docs/development.md +++ b/docs/development.md @@ -1,6 +1,6 @@ # Development Guide -There are development scripts and yaml exaples in the [`dev/`](../dev) directory that, along with the up.sh and down.sh scripts in the root of the repo, can be used to build, deploy and test changes made to the awx-operator. +There are development scripts and yaml examples in the [`dev/`](../dev) directory that, along with the up.sh and down.sh scripts in the root of the repo, can be used to build, deploy and test changes made to the awx-operator. ## Prerequisites diff --git a/up.sh b/up.sh index 6e28f437..b9ce395e 100755 --- a/up.sh +++ b/up.sh @@ -121,12 +121,20 @@ fi # -- Build & Push Operator Image echo "Preparing to build $IMG:$TAG ($IMG:$DEV_TAG) with $ENGINE..." sleep 3 -make docker-build docker-push IMG=$IMG:$TAG -# Tag and Push DEV_TAG Image when DEV_TAG_PUSH is 'True' -if $DEV_TAG_PUSH ; then - $ENGINE tag $IMG:$TAG $IMG:$DEV_TAG - make docker-push IMG=$IMG:$DEV_TAG +# Detect architecture and use multi-arch build for ARM hosts +HOST_ARCH=$(uname -m) +if [[ "$HOST_ARCH" == "aarch64" || "$HOST_ARCH" == "arm64" ]] && [ "$ENGINE" = "podman" ]; then + echo "ARM architecture detected ($HOST_ARCH). Using multi-arch build..." + make podman-buildx IMG=$IMG:$TAG ENGINE=$ENGINE +else + make docker-build docker-push IMG=$IMG:$TAG + + # Tag and Push DEV_TAG Image when DEV_TAG_PUSH is 'True' + if $DEV_TAG_PUSH ; then + $ENGINE tag $IMG:$TAG $IMG:$DEV_TAG + make docker-push IMG=$IMG:$DEV_TAG + fi fi # -- Deploy Operator