From 10a7691e5e2c659d67a5063a6bb690b7a29c1440 Mon Sep 17 00:00:00 2001 From: Michael Fritch Date: Tue, 16 Jul 2024 13:34:02 -0600 Subject: [PATCH] Use the BCI base image during Windows image build to avoid docker rate limit on the alpine linux image Signed-off-by: Michael Fritch --- Dockerfile | 41 +++++++++++++++++++++-------------------- Dockerfile.windows | 8 ++++---- 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/Dockerfile b/Dockerfile index c27c073d65..b8b5530e0f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,25 +4,26 @@ ARG KUBERNETES_VERSION=dev FROM rancher/hardened-build-base:v1.22.4b1 AS build ARG DAPPER_HOST_ARCH ENV ARCH $DAPPER_HOST_ARCH -RUN set -x && \ - apk --no-cache add \ - bash \ - curl \ - file \ - git \ - libseccomp-dev \ - rsync \ - gcc \ - bsd-compat-headers \ - py-pip \ - py3-pip \ - pigz \ - tar \ - yq \ - helm +RUN zypper refresh && \ + zypper update -y && \ + zypper install -y + bash \ + curl \ + file \ + git \ + libseccomp-dev \ + rsync \ + gcc \ + bsd-compat-headers \ + py-pip \ + py3-pip \ + pigz \ + tar \ + yq \ + helm RUN if [ "${ARCH}" = "amd64" ]; then \ - apk --no-cache add mingw-w64-gcc; \ + zypper install -y mingw-w64-gcc; \ fi FROM registry.suse.com/bci/bci-base AS rpm-macros @@ -51,13 +52,13 @@ RUN curl -sL https://dl.k8s.io/release/$( \ RUN python3 -m pip install awscli RUN curl -sL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.55.2 RUN set -x && \ - apk --no-cache add \ + zypper install -y \ libarchive-tools \ zstd \ jq \ python3 && \ if [ "${ARCH}" != "s390x" ] || [ "${GOARCH}" != "arm64" ]; then \ - apk add --no-cache rpm-dev; \ + zypper install -y rpm-dev; \ fi RUN GOCR_VERSION="v0.5.1" && \ @@ -81,7 +82,7 @@ COPY --from=rpm-macros /usr/lib/rpm/macros.d/macros.systemd /usr/lib/rpm/macros. # Shell used for debugging FROM dapper AS shell RUN set -x && \ - apk --no-cache add \ + zypper install -y \ bash-completion \ iptables \ less \ diff --git a/Dockerfile.windows b/Dockerfile.windows index 822e2363a2..2972195a2e 100644 --- a/Dockerfile.windows +++ b/Dockerfile.windows @@ -1,6 +1,6 @@ -FROM alpine:3.20 AS build +FROM registry.suse.com/bci/bci-base AS build -RUN apk --no-cache add \ +RUN zypper install -y \ curl \ unzip @@ -13,9 +13,9 @@ ENV DAPPER_OUTPUT ./dist ./bin ./build ENV DAPPER_DOCKER_SOCKET true ENV DAPPER_TARGET dapper ENV DAPPER_RUN_ARGS "--privileged --network host -v /tmp:/tmp -v rke2-pkg:/go/pkg -v rke2-cache:/root/.cache/go-build" -RUN apk update +RUN zypper refresh && zypper update RUN set -x && \ - apk add --no-cache \ + zypper install -y \ mingw-w64-gcc \ libarchive-tools \ gcc \