docker-base-distro/Makefile
Mathias Beaulieu-Duncan 734939fd12 Initial base distro with apko/Wolfi configs
Five minimal OCI image variants built with apko:
- base: ~5.5MB glibc runtime (wolfi-baselayout, libstdc++, ca-certs, tzdata)
- build: base + build tools (bash, git, curl, wget, unzip, xz)
- dotnet-runtime: base + ICU, OpenSSL, zlib for .NET runtime
- dotnet-sdk: build + ICU, OpenSSL, zlib for .NET SDK
- flutter: build variant configured for Flutter SDK

Includes melange package definitions for .NET 10 SDK/runtime and
Flutter SDK (for future use when building custom APKs).

CI/CD pipelines: publish on release, Scout CVE comparison on PRs,
weekly rebuild for Wolfi security patches.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 02:32:32 -05:00

68 lines
2.0 KiB
Makefile

REGISTRY ?= svrnty/base-distro
APKO_FLAGS ?= --log-level info
# Image variants
VARIANTS = base build dotnet-runtime dotnet-sdk flutter
.PHONY: all clean $(VARIANTS) test
all: $(VARIANTS)
# Build each variant with apko
base:
apko build $(APKO_FLAGS) apko/base.yaml $(REGISTRY):base base.tar
docker load < base.tar
@echo "Built $(REGISTRY):base"
build:
apko build $(APKO_FLAGS) apko/build.yaml $(REGISTRY):build build.tar
docker load < build.tar
@echo "Built $(REGISTRY):build"
dotnet-runtime:
apko build $(APKO_FLAGS) apko/dotnet-runtime.yaml $(REGISTRY):dotnet-runtime dotnet-runtime.tar
docker load < dotnet-runtime.tar
@echo "Built $(REGISTRY):dotnet-runtime"
dotnet-sdk:
apko build $(APKO_FLAGS) apko/dotnet-sdk.yaml $(REGISTRY):dotnet-sdk dotnet-sdk.tar
docker load < dotnet-sdk.tar
@echo "Built $(REGISTRY):dotnet-sdk"
flutter:
apko build $(APKO_FLAGS) apko/flutter.yaml $(REGISTRY):flutter flutter.tar
docker load < flutter.tar
@echo "Built $(REGISTRY):flutter"
# Test all images
test: all
@echo "=== Testing base ==="
docker run --rm $(REGISTRY):base /bin/sh -c "cat /etc/os-release"
@echo ""
@echo "=== Testing build ==="
docker run --rm $(REGISTRY):build bash -c "git --version && curl --version | head -1"
@echo ""
@echo "=== Testing dotnet-runtime ==="
docker run --rm $(REGISTRY):dotnet-runtime /bin/sh -c "ls /usr/lib/libicu*"
@echo ""
@echo "=== Testing dotnet-sdk ==="
docker run --rm $(REGISTRY):dotnet-sdk bash -c "git --version && ls /usr/lib/libicu*"
@echo ""
@echo "=== Testing flutter ==="
docker run --rm $(REGISTRY):flutter bash -c "git --version && echo PATH=\$$PATH"
@echo ""
@echo "All tests passed!"
# Show image sizes
sizes: all
@echo "=== Image Sizes ==="
@for variant in $(VARIANTS); do \
echo -n "$(REGISTRY):$$variant "; \
docker image inspect $(REGISTRY):$$variant --format '{{.Size}}' | numfmt --to=iec 2>/dev/null || \
docker image inspect $(REGISTRY):$$variant --format '{{.Size}}'; \
done
clean:
rm -f *.tar
rm -rf packages/