diff --git a/packages/filesystem/Containerfile b/packages/filesystem/Containerfile new file mode 100644 index 0000000..be67d6d --- /dev/null +++ b/packages/filesystem/Containerfile @@ -0,0 +1,32 @@ +FROM scratch as build +COPY --from=stagex/stage3 . / +WORKDIR rootfs +RUN <<-EOF + install -d -m0750 root + install -d -m0644 etc + install -d -m0644 usr + install -d -m1777 tmp + install -d -m1777 var/tmp + install -d -m1777 spool/mail + install -o 1000:1000 -d -m0755 /home/user + ln -sT usr/lib lib64 + ln -sT usr/lib lib + ln -sT usr/bin bin + ln -sT usr/sbin sbin + ln -sT lib usr/lib64 + ln -sT ../run var/run + ln -sT ../run/lock var/lock +EOF +COPY --chmod=644 <<-EOF etc/passwd + root:x:0:0:root:/root:/bin/sh + user:x:1000:1000::/home/user:/bin/sh + nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin +EOF +COPY --chmod=644 <<-EOF etc/group + root:x:0: + user:x:1000: +EOF +RUN find /rootfs -exec touch -hcd "@0" "{}" + + +FROM scratch as package +COPY --from=build /rootfs / diff --git a/src/packages.mk b/src/packages.mk index b6a2a70..c1363a0 100644 --- a/src/packages.mk +++ b/src/packages.mk @@ -292,6 +292,13 @@ out/file/index.json: \ out/perl/index.json $(call build,file) +.PHONY: filesystem +filesystem: out/filesystem/index.json +out/filesystem/index.json: \ + packages/filesystem/Containerfile \ + out/stage3/index.json + $(call build,filesystem) + .PHONY: findutils findutils: out/findutils/index.json out/findutils/index.json: \