mirror of
https://gitlab.archlinux.org/archlinux/archlinux-docker.git
synced 2026-01-07 10:21:06 +01:00
ENH: update root-less build
This commit adds: - Systemd sysusers hook is ran on the dockerfile - The dockerfile also populates the archlinux keyring - Remove the libalpm hooks as they are uneccessary now - Moved the package cleanup before the tar step on the makefile
This commit is contained in:
parent
6b583c70e7
commit
0afc2ce276
@ -3,5 +3,6 @@ ADD archlinux.tar /
|
||||
RUN update-ca-certs
|
||||
RUN locale-gen
|
||||
RUN pacman-key --init && pacman-key --populate archlinux
|
||||
RUN /usr/share/libalpm/scripts/systemd-hook sysusers
|
||||
ENV LANG=en_US.UTF-8
|
||||
CMD ["/usr/bin/bash"]
|
||||
|
||||
12
Makefile
12
Makefile
@ -3,17 +3,21 @@ DOCKER_ORGANIZATION=archlinux
|
||||
DOCKER_IMAGE:=base
|
||||
BUILDDIR=build
|
||||
|
||||
rootfs:
|
||||
hooks:
|
||||
mkdir -p alpm-hooks/usr/share/libalpm/hooks
|
||||
find /usr/share/libalpm/hooks -exec ln -s /dev/null $(PWD)/alpm-hooks{} \;
|
||||
|
||||
rootfs: hooks
|
||||
mkdir -vp $(BUILDDIR)/var/lib/pacman/
|
||||
fakechroot -- fakeroot -- pacman -Syu -r $(BUILDDIR) \
|
||||
fakechroot -- fakeroot -- pacman -Sy -r $(BUILDDIR) \
|
||||
--noconfirm --dbpath $(PWD)/$(BUILDDIR)/var/lib/pacman \
|
||||
--config rootfs/etc/pacman.conf \
|
||||
--noscriptlet \
|
||||
--hookdir $(PWD)/rootfs/usr/share/libalpm/hooks/ $(shell cat packages)
|
||||
--hookdir $(PWD)/alpm-hooks/usr/share/libalpm/hooks/ $(shell cat packages)
|
||||
cp --recursive --preserve=timestamps --backup --suffix=.pacnew rootfs/* $(BUILDDIR)/
|
||||
rm -r build/var/cache/pacman/pkg
|
||||
tar --numeric-owner --xattrs --acls --exclude-from=exclude -C $(BUILDDIR) -c . -f archlinux.tar
|
||||
rm -rf $(BUILDDIR)
|
||||
rm -rf $(BUILDDIR) alpm-hooks
|
||||
|
||||
docker-image: rootfs
|
||||
docker build -t $(DOCKER_ORGANIZATION)/$(DOCKER_IMAGE) .
|
||||
|
||||
@ -1,11 +0,0 @@
|
||||
[Trigger]
|
||||
Operation = Install
|
||||
Operation = Upgrade
|
||||
Type = Package
|
||||
Target = *
|
||||
|
||||
[Action]
|
||||
Description = Cleaning up package cache...
|
||||
Depends = coreutils
|
||||
When = PostTransaction
|
||||
Exec = /usr/bin/rm -rf /var/cache/pacman/pkg
|
||||
Loading…
x
Reference in New Issue
Block a user