Skip to content

Commit

Permalink
podvm: use multi-arch builds for components
Browse files Browse the repository at this point in the history
Signed-off-by: Obed Tetteh <obed.tetteh@ibm.com>
  • Loading branch information
redobed committed Oct 26, 2023
1 parent ef9feeb commit 282326a
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions podvm/Dockerfile.podvm_builder.rhel
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
#
FROM registry.access.redhat.com/ubi9/ubi:9.2

ARG ARCH="amd64"
ARG ARCH="x86_64"
ARG PACKER_VERSION="v1.9.4"
ARG GO_VERSION="1.20.10"
ARG PROTOC_VERSION="3.11.4"
ARG PROTOC_ARCH="x86_64"
ARG RUST_VERSION="1.72.0"
ARG ORG_ID
ARG ACTIVATION_KEY
ARG YQ_VERSION="v4.35.1"

ENV SMDEV_CONTAINER_OFF=1
ENV ARCH ${ARCH}

# This registering RHEL when building on an unsubscribed system
# If you are running a UBI container on a registered and subscribed RHEL host, the main RHEL Server repository is enabled inside the standard UBI container
Expand All @@ -30,12 +30,11 @@ RUN subscription-manager repos --enable codeready-builder-for-rhel-9-${ARCH}-rpm
dnf install -y yum-utils gnupg git --allowerasing curl pkg-config clang perl libseccomp-devel gpgme-devel \
device-mapper-devel qemu-kvm unzip wget libassuan-devel genisoimage cloud-utils-growpart cloud-init;

ADD https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_${ARCH} /usr/local/bin/yq
RUN chmod a+x /usr/local/bin/yq

RUN curl https://dl.google.com/go/go${GO_VERSION}.linux-${ARCH}.tar.gz -o go${GO_VERSION}.linux-${ARCH}.tar.gz && \
rm -rf /usr/local/go && tar -C /usr/local -xzf go${GO_VERSION}.linux-${ARCH}.tar.gz && \
rm -f go${GO_VERSION}.linux-${ARCH}.tar.gz
RUN wget https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_${ARCH/x86_64/amd64} -O /usr/local/bin/yq && \
chmod a+x /usr/local/bin/yq && \
curl https://dl.google.com/go/go${GO_VERSION}.linux-${ARCH/x86_64/amd64}.tar.gz -o go${GO_VERSION}.linux-${ARCH/x86_64/amd64}.tar.gz && \
rm -rf /usr/local/go && tar -C /usr/local -xzf go${GO_VERSION}.linux-${ARCH/x86_64/amd64}.tar.gz && \
rm -f go${GO_VERSION}.linux-${ARCH/x86_64/amd64}.tar.gz
ENV PATH="/usr/local/go/bin:${PATH}"

# Install packer. Packer doesn't does not have prebuilt s390x arch binaries above Packer version 0.1.5
Expand All @@ -51,7 +50,7 @@ RUN if [ "${ARCH}" == "s390x" ]; then \
dnf install -y packer; \
fi

# set a corrspond qemu-system-* named link to qemu-kvm
# set a correspond qemu-system-* named link to qemu-kvm
RUN ln -s /usr/libexec/qemu-kvm /usr/bin/qemu-system-$(uname -m)

# cloud-utils package is not available for rhel.
Expand All @@ -62,8 +61,8 @@ RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain "${RUST_VER

ENV PATH "/root/.cargo/bin:/usr/local/go/bin:$PATH"

RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-${PROTOC_ARCH}.zip && \
unzip protoc-${PROTOC_VERSION}-linux-${PROTOC_ARCH}.zip -d /usr/local && rm -f protoc-${PROTOC_VERSION}-linux-${PROTOC_ARCH}.zip
RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-${ARCH/s390x/s390_64}.zip && \
unzip protoc-${PROTOC_VERSION}-linux-${ARCH/s390x/s390_64}.zip -d /usr/local && rm -f protoc-${PROTOC_VERSION}-linux-${ARCH/s390x/s390_64}.zip

WORKDIR /src

Expand Down

0 comments on commit 282326a

Please sign in to comment.