1- FROM quay.io/centos/centos:stream9 as base
1+ ARG image="quay.io/centos/centos:stream9"
2+ FROM ${image} as base
23ARG channel="stable"
34ARG location
45
56RUN [ -z "${channel}" ] && echo "ARG channel is required" && exit 1 || true
67
78RUN yum -y install jq xz
89RUN 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'
10+ ; curl https://builds.coreos.fedoraproject.org/streams/${channel}.json -o stable.json && \
11+ cat stable.json | jq -r --arg arch "$ARCH" '.architectures[$arch].artifacts.qemu.release'
1112
1213
1314FROM base AS executor-img
1415
15- RUN if [[ -z "$arg" ]] ; then \
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 ; \
20- else \
21- echo "Downloading" ${location} && \
22- curl -s -o coreos_production_qemu_image.qcow2.xz ${location} && unxz coreos_production_qemu_image.qcow2.xz \
23- ; fi
24-
16+ RUN ARCH=$(uname -m) ; echo $ARCH ; \
17+ if [[ $ARCH == "ppc64le" ]] ; then \
18+ echo "Downloading https://builds.coreos.fedoraproject.org/prod/streams/stable/builds/36.20220906.3.1/ppc64le/fedora-coreos-36.20220906.3.1-qemu.ppc64le.qcow2.xz" && \
19+ curl -s -o coreos_production_qemu_image.qcow2.xz https://builds.coreos.fedoraproject.org/prod/streams/stable/builds/36.20220906.3.1/ppc64le/fedora-coreos-36.20220906.3.1-qemu.ppc64le.qcow2.xz && \
20+ unxz coreos_production_qemu_image.qcow2.xz ; \
21+ else \
22+ echo $ARCH && \
23+ echo "Downloading" $(cat stable.json | jq -r --arg arch "$ARCH" '.architectures[$arch].artifacts.qemu.formats."qcow2.xz".disk.location' ) && \
24+ 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' ) && \
25+ unxz coreos_production_qemu_image.qcow2.xz \
26+ ; fi
2527
2628FROM base AS final
2729ARG channel=stable
@@ -30,9 +32,9 @@ RUN mkdir -p /userdata
3032WORKDIR /userdata
3133
3234RUN yum -y update && \
33- yum -y remove jq && \
34- yum -y install openssh-clients qemu-kvm && \
35- yum -y clean all
35+ yum -y remove jq && \
36+ yum -y install openssh-clients qemu-kvm && \
37+ yum -y clean all
3638
3739COPY --from=executor-img /coreos_production_qemu_image.qcow2 /userdata/coreos_production_qemu_image.qcow2
3840COPY start.sh /userdata/start.sh
0 commit comments