Skip to content

Commit 44210d2

Browse files
author
Oleg Bulatov
authored
Merge pull request #5 from ksdeekshith/IBMZ_Support
QUAY-BUILDER-QEMU support on IBMZ
2 parents 03b4ef4 + 3c08b8c commit 44210d2

File tree

3 files changed

+18
-8
lines changed

3 files changed

+18
-8
lines changed

.github/workflows/build-and-publish.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,20 @@ jobs:
3636
username: ${{ secrets.QUAY_USER }}
3737
password: ${{ secrets.QUAY_TOKEN }}
3838

39+
- name: Set up QEMU
40+
uses: docker/setup-qemu-action@v2
41+
42+
- name: Set up Docker Buildx
43+
uses: docker/setup-buildx-action@v2
44+
3945
- name: Build and push
4046
id: docker_build
4147
uses: docker/build-push-action@v2
4248
env:
4349
TAG: ${{ steps.version-from-branch.outputs.version }}${{ env.TAG_SUFFIX }}
4450
with:
45-
build-args: channel=stable version=current
51+
platforms: linux/amd64, linux/s390x
52+
build-args: channel=stable
4653
push: true
4754
file: Dockerfile
4855
tags: ${{ env.REGISTRY }}/${{ env.REPO_NAME }}:${{ github.event.inputs.tag || env.TAG }}

Dockerfile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
1-
FROM centos:8 as base
1+
FROM quay.io/centos/centos:stream9 as base
22
ARG channel="stable"
33
ARG location
44

55
RUN [ -z "${channel}" ] && echo "ARG channel is required" && exit 1 || true
66

77
RUN yum -y install jq
8-
RUN curl https://builds.coreos.fedoraproject.org/streams/${channel}.json -o stable.json && \
9-
cat stable.json | jq '.architectures.x86_64.artifacts.qemu.release' | tr -d '"'
8+
RUN ARCH=$(uname -m) ; echo $ARCH \
9+
; curl https://builds.coreos.fedoraproject.org/streams/${channel}.json -o stable.json && \
10+
cat stable.json | jq -r --arg arch "$ARCH" '.architectures[$arch].artifacts.qemu.release'
1011

1112

1213
FROM base AS executor-img
1314

1415
RUN if [[ -z "$arg" ]] ; then \
15-
echo "Downloading" $(cat stable.json | jq '.architectures.x86_64.artifacts.qemu.formats."qcow2.xz".disk.location' | tr -d '"') && \
16-
curl -s -o coreos_production_qemu_image.qcow2.xz $(cat stable.json | jq '.architectures.x86_64.artifacts.qemu.formats."qcow2.xz".disk.location' | tr -d '"') && unxz coreos_production_qemu_image.qcow2.xz ; \
16+
ARCH=$(uname -m) ; echo $ARCH ; \
17+
echo "Downloading" $(cat stable.json | jq -r --arg arch "$ARCH" '.architectures[$arch].artifacts.qemu.formats."qcow2.xz".disk.location') && \
18+
curl -s -o coreos_production_qemu_image.qcow2.xz $(cat stable.json | jq -r --arg arch "$ARCH" '.architectures[$arch].artifacts.qemu.formats."qcow2.xz".disk.location') && \
19+
unxz coreos_production_qemu_image.qcow2.xz ; \
1720
else \
1821
echo "Downloading" ${location} && \
1922
curl -s -o coreos_production_qemu_image.qcow2.xz ${location} && unxz coreos_production_qemu_image.qcow2.xz \

build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ set -o nounset
44
TAG=${TAG:-"stable"}
55
IMAGE=${IMAGE:-"quay.io/quay/quay-builder-qemu-fedoracoreos"}
66
CLOUD_IMAGE=${CLOUD_IMAGE:-""}
7+
ARCH=$(uname -m)
78

89
if [ -z "$CLOUD_IMAGE" ]; then
910
CHANNEL=${CHANNEL:-"stable"}
1011
CHANNEL_MANIFEST_JSON=`curl https://builds.coreos.fedoraproject.org/streams/${CHANNEL}.json`
11-
LOCATION=`echo $CHANNEL_MANIFEST_JSON | jq '.architectures.x86_64.artifacts.qemu.formats."qcow2.xz".disk.location' | tr -d '"'`
12-
VERSION=`echo $CHANNEL_MANIFEST_JSON | jq '.architectures.x86_64.artifacts.qemu.release' | tr -d '"'`
12+
LOCATION=`echo $CHANNEL_MANIFEST_JSON | jq -r --arg arch "$ARCH" '.architectures[$arch].artifacts.qemu.formats."qcow2.xz".disk.location'`
1313

1414
time docker build --build-arg=channel=$CHANNEL --build-arg --build-arg -t $IMAGE:$TAG .
1515
else

0 commit comments

Comments
 (0)