Files
kata-containers/tools/packaging/static-build/busybox/Dockerfile
Fabiano Fidêncio 1388a3acda packaging: Add ORAS cache for gperf and busybox tarballs
To protect against upstream download failures for gperf and busybox,
implement ORAS-based caching to GHCR.

This adds:
- download-with-oras-cache.sh: Core helper for downloading with cache
- populate-oras-tarball-cache.sh: Script to manually populate cache
- warn() function to lib.sh for consistency

Modified build scripts to:
- Try ORAS cache first (from ghcr.io/kata-containers/kata-containers)
- Fall back to upstream download on cache miss
- Automatically push to cache when PUSH_TO_REGISTRY=yes

The cache is automatically populated during CI builds, and parallel
architecture builds check for existing versions before pushing to avoid
race conditions.

Forks benefit from upstream cache but can override with their own:
ARTEFACT_REPOSITORY=myorg/kata make agent-tarball

Generated-By: Cursor IDE with Claude
Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
2025-12-15 22:04:21 +01:00

25 lines
895 B
Docker

# Copyright (c) 2024 NVIDIA Corporation
#
# SPDX-License-Identifier: Apache-2.0
FROM alpine:3.20.0
# Install build dependencies and ORAS for cache support
RUN apk update && apk --no-cache add gpg gpg-agent coreutils bash curl make \
gcc g++ pkgconf libselinux-dev gpg-agent
# Install ORAS CLI for tarball caching
ARG ORAS_VERSION=1.3.0
RUN ARCH=$(uname -m) && \
case "${ARCH}" in \
x86_64) ORAS_ARCH="amd64" ;; \
aarch64) ORAS_ARCH="arm64" ;; \
ppc64le) ORAS_ARCH="ppc64le" ;; \
s390x) ORAS_ARCH="s390x" ;; \
*) echo "Unsupported architecture: ${ARCH}" && exit 1 ;; \
esac && \
curl -sSL "https://github.com/oras-project/oras/releases/download/v${ORAS_VERSION}/oras_${ORAS_VERSION}_linux_${ORAS_ARCH}.tar.gz" -o /tmp/oras.tar.gz && \
tar -xzf /tmp/oras.tar.gz -C /usr/local/bin oras && \
rm /tmp/oras.tar.gz && \
oras version