diff --git a/Dockerfile b/Dockerfile index cde2238..6d64765 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,6 @@ FROM scratch ADD archlinux.tar / +RUN locale-gen +RUN pacman-key --init && pacman-key --populate archlinux ENV LANG=en_US.UTF-8 CMD ["/usr/bin/bash"] diff --git a/Makefile b/Makefile index 9a94322..df67303 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,16 @@ DOCKER_USER:=pierres DOCKER_ORGANIZATION=archlinux DOCKER_IMAGE:=base +BUILDDIR=build rootfs: - $(eval TMPDIR := $(shell mktemp -d)) - env -i pacstrap -C /usr/share/devtools/pacman-extra.conf -c -d -G -M $(TMPDIR) $(shell cat packages) - cp --recursive --preserve=timestamps --backup --suffix=.pacnew rootfs/* $(TMPDIR)/ - arch-chroot $(TMPDIR) locale-gen - arch-chroot $(TMPDIR) pacman-key --init - arch-chroot $(TMPDIR) pacman-key --populate archlinux - tar --numeric-owner --xattrs --acls --exclude-from=exclude -C $(TMPDIR) -c . -f archlinux.tar - rm -rf $(TMPDIR) + mkdir -vp $(BUILDDIR)/var/lib/pacman/ + fakeroot -- pacman -Syu -r $(BUILDDIR) \ + --noconfirm --dbpath $(PWD)/$(BUILDDIR)/var/lib/pacman \ + --hookdir rootfs/usr/share/libalpm/hooks/ $(shell cat packages) + cp --recursive --preserve=timestamps --backup --suffix=.pacnew rootfs/* $(BUILDDIR)/ + tar --numeric-owner --xattrs --acls --exclude-from=exclude -C $(BUILDDIR) -c . -f archlinux.tar + rm -rf $(BUILDDIR) docker-image: rootfs docker build -t $(DOCKER_ORGANIZATION)/$(DOCKER_IMAGE) .