stagex/packages/filesystem/Containerfile

33 lines
763 B
Text
Raw Normal View History

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 /