From 3d21c595177eca84a2fe826f9f5adfb458bfdd9f Mon Sep 17 00:00:00 2001 From: Hao Liu <44379968+TheRealHaoLiu@users.noreply.github.com> Date: Mon, 26 Feb 2024 17:38:04 -0500 Subject: [PATCH] Build and push amd64 and arm64 image --- .github/workflows/build-latest.yml | 19 ++++++++++--------- execution-environment.yml | 2 ++ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-latest.yml b/.github/workflows/build-latest.yml index 83f049a..ce7fa25 100644 --- a/.github/workflows/build-latest.yml +++ b/.github/workflows/build-latest.yml @@ -23,18 +23,19 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install tox + pip install -r requirements.txt - name: Quay login run: | echo "${{ secrets.QUAY_TOKEN }}" | docker login quay.io -u ${{ secrets.QUAY_USERNAME }} --password-stdin - - name: Build image - env: - DOCKER_BUILDKIT: 1 + - name: Build and push image run: | - tox -e docker -- --tag=${{ vars.IMAGE_REGISTRY }}/awx-ee:latest - - - name: Push images - run: | - docker push ${{ vars.IMAGE_REGISTRY }}/awx-ee:latest + docker buildx create --name awx-ee-buildx + docker buildx use awx-ee-buildx + ansible-builder create -v3 --output-file=Dockerfile + docker buildx build \ + --push \ + --platform=linux/amd64,linux/arm64 \ + --tag=${{ vars.IMAGE_REGISTRY }}/awx-ee:latest \ + context diff --git a/execution-environment.yml b/execution-environment.yml index 823b2ee..5455ba1 100644 --- a/execution-environment.yml +++ b/execution-environment.yml @@ -56,6 +56,8 @@ dependencies: additional_build_steps: append_base: - RUN $PYCMD -m pip install -U pip + prepend_builder: + - RUN $PKGMGR install -y cmake gcc gcc-c++ make openssl-devel # needed for building uamqp for azure.azcollection on arm64 append_final: - COPY --from=quay.io/ansible/receptor:devel /usr/bin/receptor /usr/bin/receptor - RUN mkdir -p /var/run/receptor