-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
66 lines (53 loc) · 2.05 KB
/
Makefile
File metadata and controls
66 lines (53 loc) · 2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
IMAGE_BASE:=ghcr.io/luzifer-docker/archlinux
BUILD_TIMESTAMP:=$(shell date --iso-8601=seconds --utc)
default: seed
default: docker-image_minimal
default: docker-image-test_latest
default: docker-push_latest
jenkins: docker-image_minimal
jenkins: docker-image-test_latest
jenkins: docker-push_latest
jenkins: docker-image_base
jenkins: docker-image-test_base
jenkins: docker-push_base
jenkins: docker-image_base-devel
jenkins: docker-image-test_base-devel
jenkins: docker-push_base-devel
rootfs_minimal:
docker run --rm -i -v "$(CURDIR):$(CURDIR)" -w "$(CURDIR)" \
--privileged --tmpfs=/tmp:exec --tmpfs=/run/shm \
$(IMAGE_BASE):latest \
sh -c 'pacman -Sy --noconfirm devtools tar && bash mkroots.sh'
rootfs_%:
docker run --rm -i -v "$(CURDIR):$(CURDIR)" -w "$(CURDIR)" \
--privileged --tmpfs=/tmp:exec --tmpfs=/run/shm \
$(IMAGE_BASE):latest \
sh -c 'pacman -Sy --noconfirm devtools tar && bash mkroots.sh $*'
docker-image_minimal: rootfs_minimal
docker build \
--label org.opencontainers.image.created="${BUILD_TIMESTAMP}" \
--tag $(IMAGE_BASE):latest \
.
docker-image_%:
$(MAKE) rootfs_$*
docker build \
--label org.opencontainers.image.created="${BUILD_TIMESTAMP}" \
--tag $(IMAGE_BASE):$* \
.
docker-image-test_%:
# FIXME: /etc/mtab is hidden by docker so the stricter -Qkk fails
docker run --rm $(IMAGE_BASE):$* sh -c "/usr/bin/pacman -Sy && /usr/bin/pacman -Qqk"
docker run --rm $(IMAGE_BASE):$* sh -c "/usr/bin/pacman -Syu --noconfirm docker && docker -v"
# Ensure that the image does not include a private key
! docker run --rm $(IMAGE_BASE):$* pacman-key --lsign-key pierre@archlinux.de
docker run --rm $(IMAGE_BASE):$* sh -c "/usr/bin/id -u http"
docker run --rm $(IMAGE_BASE):$* sh -c "/usr/bin/pacman -Syu --noconfirm grep && locale | grep -q UTF-8"
docker-push_%:
docker push $(IMAGE_BASE):$*
# Special build target to locally build the first minimal image
seed: test_archlinux
bash mkroots.sh
docker build -t $(IMAGE_BASE):latest .
test_archlinux:
which pacstrap
.PHONY: rootfs docker-image docker-image-test ci-test docker-push