From b2e07647e948d1d0fb71c811d87db24198addddf Mon Sep 17 00:00:00 2001 From: Linux Ninja Date: Sat, 10 Aug 2019 02:57:40 -0400 Subject: [PATCH 1/4] add fakechroot dependency in README.md, prevent 'already exists' error when running ln -s by adding -f in Makefile, combine two layers of Dockerfile and fix typo of pugring.gpg~ Signed-off-by: Linux Ninja --- Dockerfile | 5 ++--- Makefile | 2 +- README.md | 1 + 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index e071867..65f92c1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,9 +5,8 @@ ADD archlinux.tar.xz / RUN ldconfig && update-ca-trust && locale-gen RUN sh -c 'ls usr/lib/sysusers.d/*.conf | /usr/share/libalpm/scripts/systemd-hook sysusers ' -# initialize the archilnux keyring, but discard any private key that may be shipped. -RUN pacman-key --init && pacman-key --populate archlinux -RUN rm -rf etc/pacman.d/gnupg/{openpgp-revocs.d/,private-keys-v1.d/,pugring.gpg~,gnupg.S.}* +# initialize the archlinux keyring, but discard any private key that may be shipped. +RUN pacman-key --init && pacman-key --populate archlinux && rm -rf etc/pacman.d/gnupg/{openpgp-revocs.d/,private-keys-v1.d/,pubring.gpg~,gnupg.S.}* ENV LANG=en_US.UTF-8 CMD ["/usr/bin/bash"] diff --git a/Makefile b/Makefile index 4cfd2ee..22a7c25 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ PWD=$(shell pwd) hooks: mkdir -p alpm-hooks/usr/share/libalpm/hooks - find /usr/share/libalpm/hooks -exec ln -s /dev/null $(PWD)/alpm-hooks{} \; + find /usr/share/libalpm/hooks -exec ln -sf /dev/null $(PWD)/alpm-hooks{} \; rootfs: hooks mkdir -vp $(BUILDDIR)/var/lib/pacman/ diff --git a/README.md b/README.md index 4dfbc53..d319da5 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ Install the following Arch Linux packages: * make * devtools * docker +* fakechroot ## Usage Run `make docker-image` as root to build the base image. ## Purpose From eaa38cb44e7c24d7256de973dc4b832d99a40c1c Mon Sep 17 00:00:00 2001 From: Linux Ninja Date: Sat, 10 Aug 2019 03:16:54 -0400 Subject: [PATCH 2/4] add xz params to tighten archive size (saves 5M currently), use all available CPU cores, overwrite existing file Signed-off-by: Linux Ninja --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 22a7c25..5b62979 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ rootfs: hooks rm -rf $(BUILDDIR) alpm-hooks compress-rootfs: rootfs - xz archlinux.tar + xz -9e -T0 -f archlinux.tar docker-image: compress-rootfs docker build -t $(DOCKER_ORGANIZATION)/$(DOCKER_IMAGE) . From 026d2788dffdf2de5880aaa71e6c0b7d6b823dcb Mon Sep 17 00:00:00 2001 From: Justin Kromlinger Date: Thu, 30 Jul 2020 17:55:18 +0200 Subject: [PATCH 3/4] Add fakeroot as a build dependency --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index d319da5..8e80316 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ Install the following Arch Linux packages: * devtools * docker * fakechroot +* fakeroot ## Usage Run `make docker-image` as root to build the base image. ## Purpose From cbaf17832edb9767a623034b7fe1dceb7b245854 Mon Sep 17 00:00:00 2001 From: Justin Kromlinger Date: Thu, 30 Jul 2020 17:55:36 +0200 Subject: [PATCH 4/4] Add the ability to adjust the thread count of xz, drop -e `xz --extreme` would only save us about 1MB but take ~50% longer. --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 6bbf628..dfe2e9c 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,8 @@ DOCKER_IMAGE:=base BUILDDIR=build PWD=$(shell pwd) +XZ_THREADS ?= 0 + hooks: mkdir -p alpm-hooks/usr/share/libalpm/hooks find /usr/share/libalpm/hooks -exec ln -sf /dev/null $(PWD)/alpm-hooks{} \; @@ -30,8 +32,7 @@ rootfs: hooks archlinux.tar: rootfs compress-rootfs: archlinux.tar - xz -f archlinux.tar - xz -9e -T0 -f archlinux.tar + xz -9 -T"$(XZ_THREADS)" -f archlinux.tar docker-image: compress-rootfs docker build -t $(DOCKER_ORGANIZATION)/$(DOCKER_IMAGE) .