archlinux-docker/Makefile
Mark Hegreberg 20bbc94b91
repro POC
this commit takes the relevant repro steps from the wsl image, and wraps
breaking changes to only affect the :repro image

testing reproducability is not yet included, so we can discuss the
approach first
2026-03-27 19:36:32 -07:00

24 lines
913 B
Makefile

OCITOOL=podman # or docker
BUILDDIR=$(shell pwd)/build
OUTPUTDIR=$(shell pwd)/output
ARCHIVE_SNAPSHOT=$(shell date -d "$(awk -F. '{print $1"-"$2"-"$3}' <<< "$IMAGE_VERSION") -1 day" +"%Y/%m/%d")
SOURCE_DATE_EPOCH=$(shell date -u -d "$(echo "$ARCHIVE_SNAPSHOT")" +"%s")
.PHONY: clean
clean:
rm -rf $(BUILDDIR) $(OUTPUTDIR)
.PRECIOUS: $(OUTPUTDIR)/%.tar.zst
$(OUTPUTDIR)/%.tar.zst:
scripts/make-rootfs.sh $(*) $(BUILDDIR) $(OUTPUTDIR) $(ARCHIVE_SNAPSHOT) $(SOURCE_DATE_EPOCH)
.PRECIOUS: $(OUTPUTDIR)/Dockerfile.%
$(OUTPUTDIR)/Dockerfile.%: $(OUTPUTDIR)/%.tar.zst
scripts/make-dockerfile.sh "$(*).tar.zst" $(*) $(OUTPUTDIR) "true" "Dev"
# The following is for local builds only, it is not used by the CI/CD pipeline
all: image-repro image-base image-base-devel image-multilib-devel
image-%: $(OUTPUTDIR)/Dockerfile.%
${OCITOOL} build -f $(OUTPUTDIR)/Dockerfile.$(*) -t archlinux/archlinux:$(*) $(OUTPUTDIR)