Skip to content

Commit 333e356

Browse files
committed
Add Makefile with targets to build docker/rootfs
1 parent 019da34 commit 333e356

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

Makefile

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
PLATFORMS?=linux/arm64
2+
IMAGE?=archlinuxarm
3+
4+
.PHONY: qemu
5+
qemu:
6+
docker run --privileged --rm tonistiigi/binfmt --install arm64
7+
8+
# --- Builds ---
9+
.PHONY: build-minimal
10+
build-minimal:
11+
docker buildx build \
12+
--platform $(PLATFORMS) \
13+
-t $(IMAGE):minimal-aarch64 \
14+
-f dockerfiles/Dockerfile.base \
15+
--target archarm \
16+
--load \
17+
.
18+
19+
.PHONY: export
20+
export:
21+
docker buildx build \
22+
--platform $(PLATFORMS) \
23+
-t $(IMAGE):minimal-aarch64-export \
24+
-f dockerfiles/Dockerfile.base.aarch64 \
25+
--target export \
26+
--load .
27+
28+
.PHONY: create-rootfs-container
29+
create-rootfs-container:
30+
docker create --platform=linux/arm64 --name take $(IMAGE):minimal-aarch64-export sh
31+
32+
.PHONY: copy-rootfs-tar
33+
copy-rootfs-tar:
34+
docker cp take:/archlinuxarm-aarch64-rootfs.tar ./rootfs.tar
35+
docker rm -f take
36+
37+
.PHONY: prepare-rpi-img
38+
prepare-rpi-image: export create-rootfs-container copy-rootfs-tar
39+
./scripts/build_img.sh

0 commit comments

Comments
 (0)