mirror of
https://github.com/lukaszraczylo/kubernetes-images-sync-operator.git
synced 2026-10-12 00:45:27 +00:00
fix(docker): retry apt installs in the worker image
The libc-bin post-install step segfaults intermittently under QEMU arm64 emulation. Install packages through a small retry helper that reruns dpkg --configure after a failure.
This commit is contained in:
+12
-13
@@ -4,23 +4,22 @@ ENV DEBIAN_FRONTEND=noninteractive
|
|||||||
ARG TARGETPLATFORM
|
ARG TARGETPLATFORM
|
||||||
ARG TARGETARCH
|
ARG TARGETARCH
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
# ldconfig can segfault intermittently under QEMU arm64 emulation; retry and reconfigure.
|
||||||
ca-certificates \
|
RUN printf '%s\n' '#!/bin/sh' \
|
||||||
curl \
|
'for i in 1 2 3 4 5; do' \
|
||||||
gnupg2 \
|
' apt-get update && apt-get install -y --no-install-recommends "$@" && rm -rf /var/lib/apt/lists/* && exit 0' \
|
||||||
sudo \
|
' dpkg --configure -a || true' \
|
||||||
jq \
|
' sleep 3' \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
'done' \
|
||||||
|
'exit 1' > /usr/local/bin/apt-retry \
|
||||||
|
&& chmod +x /usr/local/bin/apt-retry
|
||||||
|
|
||||||
|
RUN apt-retry ca-certificates curl gnupg2 sudo jq
|
||||||
|
|
||||||
RUN echo "deb [arch=${TARGETARCH}] https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_22.04/ /" | tee /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list \
|
RUN echo "deb [arch=${TARGETARCH}] https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_22.04/ /" | tee /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list \
|
||||||
&& curl -fsSL "https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_22.04/Release.key" | apt-key add -
|
&& curl -fsSL "https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_22.04/Release.key" | apt-key add -
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
RUN apt-retry uidmap fuse-overlayfs podman netavark
|
||||||
uidmap \
|
|
||||||
fuse-overlayfs \
|
|
||||||
podman \
|
|
||||||
netavark \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
RUN adduser --disabled-password --gecos "" --uid 1001 runner \
|
RUN adduser --disabled-password --gecos "" --uid 1001 runner \
|
||||||
&& groupadd docker --gid 123 \
|
&& groupadd docker --gid 123 \
|
||||||
|
|||||||
Reference in New Issue
Block a user