Makefile 708 Bytes
Newer Older
Pierre Schmitz's avatar
Pierre Schmitz committed
1
2
3
DOCKER_USER := 'pierres'
DOCKER_IMAGE := 'archlinux'

Pierre Schmitz's avatar
Pierre Schmitz committed
4
5
rootfs:
	$(eval TMPDIR := $(shell mktemp -d))
Pierre Schmitz's avatar
Pierre Schmitz committed
6
	pacstrap -C /usr/share/devtools/pacman-extra.conf -c -d -G -M $(TMPDIR) $(shell cat packages)
Pierre Schmitz's avatar
Pierre Schmitz committed
7
	cp -rp --backup --suffix=.pacnew rootfs/* $(TMPDIR)/
Pierre Schmitz's avatar
Pierre Schmitz committed
8
9
10
	arch-chroot $(TMPDIR) locale-gen
	arch-chroot $(TMPDIR) pacman-key --init
	arch-chroot $(TMPDIR) pacman-key --populate archlinux
Pierre Schmitz's avatar
Pierre Schmitz committed
11
	tar --numeric-owner --xattrs --acls --exclude-from=exclude -C $(TMPDIR) -c . -f archlinux.tar
Pierre Schmitz's avatar
Pierre Schmitz committed
12
13
14
	rm -rf $(TMPDIR)

docker-image: rootfs
Pierre Schmitz's avatar
Pierre Schmitz committed
15
16
17
18
19
	docker build -t $(DOCKER_USER)/$(DOCKER_IMAGE) .

docker-push: docker-image
	docker login -u $(DOCKER_USER)
	docker push $(DOCKER_USER)/$(DOCKER_IMAGE)
Pierre Schmitz's avatar
Pierre Schmitz committed
20

Pierre Schmitz's avatar
Pierre Schmitz committed
21
.PHONY: rootfs docker-image docker-push