diff --git a/Containerfile b/Containerfile index 86dacc67..c3b7b580 100644 --- a/Containerfile +++ b/Containerfile @@ -57,6 +57,7 @@ ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION}" # dx specific files come from the dx directory in this repo COPY dx/etc /etc COPY dx/usr /usr +COPY workarounds.sh /tmp/workarounds.sh RUN wget https://copr.fedorainfracloud.org/coprs/ganto/lxc4/repo/fedora-"${FEDORA_MAJOR_VERSION}"/ganto-lxc4-fedora-"${FEDORA_MAJOR_VERSION}".repo -O /etc/yum.repos.d/ganto-lxc4-fedora-"${FEDORA_MAJOR_VERSION}".repo RUN wget https://terra.fyralabs.com/terra.repo -O /etc/yum.repos.d/terra.repo @@ -74,6 +75,8 @@ COPY --from=cgr.dev/chainguard/helm:latest /usr/bin/helm /usr/bin/helm COPY --from=cgr.dev/chainguard/ko:latest /usr/bin/ko /usr/bin/ko COPY --from=cgr.dev/chainguard/minio-client:latest /usr/bin/mc /usr/bin/mc +RUN /tmp/workarounds.sh + # Clean up repos, everything is on the image so we don't need them RUN rm -f /etc/yum.repos.d/terra.repo RUN rm -f /etc/yum.repos.d/ganto-lxc4-fedora-"${FEDORA_MAJOR_VERSION}".repo diff --git a/workarounds.sh b/workarounds.sh new file mode 100755 index 00000000..6b469a3b --- /dev/null +++ b/workarounds.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +set -oeux pipefail + +# alternatives cannot create symlinks on its own during a container build +ln -sf /usr/bin/ld.bfd /etc/alternatives/ld && ln -sf /etc/alternatives/ld /usr/bin/ld