mirror of
https://github.com/luzifer-docker/archlinux.git
synced 2024-12-20 11:01:23 +00:00
26 lines
1 KiB
Makefile
26 lines
1 KiB
Makefile
DOCKER_USER := 'pierres'
|
|
DOCKER_IMAGE := 'archlinux'
|
|
|
|
rootfs:
|
|
$(eval TMPDIR := $(shell mktemp -d))
|
|
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)
|
|
|
|
docker-image: rootfs
|
|
docker build -t $(DOCKER_USER)/$(DOCKER_IMAGE) .
|
|
|
|
docker-image-test: docker-image
|
|
# FIXME: /etc/mtab is hidden by docker so the stricter -Qkk fails
|
|
docker run --rm $(DOCKER_USER)/$(DOCKER_IMAGE) sh -c "/usr/bin/pacman -Sy && /usr/bin/pacman -Qqk"
|
|
docker run --rm $(DOCKER_USER)/$(DOCKER_IMAGE) sh -c "/usr/bin/pacman -Syu --noconfirm docker && docker -v"
|
|
|
|
docker-push: docker-image-test
|
|
docker login -u $(DOCKER_USER)
|
|
docker push $(DOCKER_USER)/$(DOCKER_IMAGE)
|
|
|
|
.PHONY: rootfs docker-image docker-image-test docker-push
|