FROM git.hydrar.de/navos/navos:latest as builder
ARG TARGETARCH
# Download rootfs
RUN pacman -Syu --noconfirm && pacman -S --noconfirm wget
RUN mkdir /os && wget -O - "https://navos.hydrar.de/rootfs/${TARGETARCH}/rootfs.tar.xz" | tar --numeric-owner --xattrs --acls -xf - -C /os

# Copy
FROM scratch
COPY --from=builder /os/ /

# Update
RUN pacman -Syu --noconfirm

CMD ["/bin/sh"]