mirror of
https://gitlab.archlinux.org/archlinux/archlinux-docker.git
synced 2026-01-10 11:51:06 +01:00
Embedding one pieces of code into another (shell script into a makefiles in this case) is rarely pretty. Split things up, as appropriate. While here, simplify the rootfs in a few ways: - pass only the extra non-base (and effectively group name) package - add a handy variable for the fakeroot/fakechroot combo - split and rewrap long lines As a bonus point, this makes it easier to use pattern rules in the makefile - which will be handy for the upcoming multilib-devel group/target. Plus we can check the scripts via shellcheck/etc CI stage, as follow-up. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
30 lines
954 B
Makefile
30 lines
954 B
Makefile
OCITOOL=podman # or docker
|
|
BUILDDIR=$(shell pwd)/build
|
|
OUTPUTDIR=$(shell pwd)/output
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
rm -rf $(BUILDDIR) $(OUTPUTDIR)
|
|
|
|
$(OUTPUTDIR)/base.tar.zst:
|
|
scripts/make-rootfs.sh base $(BUILDDIR) $(OUTPUTDIR)
|
|
|
|
$(OUTPUTDIR)/base-devel.tar.zst:
|
|
scripts/make-rootfs.sh base-devel $(BUILDDIR) $(OUTPUTDIR)
|
|
|
|
$(OUTPUTDIR)/Dockerfile.base: $(OUTPUTDIR)/base.tar.zst
|
|
scripts/make-dockerfile.sh base $(OUTPUTDIR)
|
|
|
|
$(OUTPUTDIR)/Dockerfile.base-devel: $(OUTPUTDIR)/base-devel.tar.zst
|
|
scripts/make-dockerfile.sh base-devel $(OUTPUTDIR)
|
|
|
|
# The following is for local builds only, it is not used by the CI/CD pipeline
|
|
|
|
.PHONY: image-base
|
|
image-base: $(OUTPUTDIR)/Dockerfile.base
|
|
${OCITOOL} build -f $(OUTPUTDIR)/Dockerfile.base -t archlinux/archlinux:base $(OUTPUTDIR)
|
|
|
|
.PHONY: image-base-devel
|
|
image-base-devel: $(OUTPUTDIR)/Dockerfile.base-devel
|
|
${OCITOOL} build -f $(OUTPUTDIR)/Dockerfile.base-devel -t archlinux/archlinux:base-devel $(OUTPUTDIR)
|