[Buildroot] [PATCH v3 2/7] board/guest: documentation and sample files

Christian Stewart christian at paral.in
Mon Jul 27 20:49:02 UTC 2020


Peter,

On Mon, Jul 27, 2020 at 2:46 AM Peter Korsgaard <peter at korsgaard.com> wrote:
>  > +    $ docker build --tag br:guest .
>  > +    $ docker images
>  > +    REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
>  > +    br                  guest               0c54c85a3452        42 seconds ago      1.75MB
>
> NIT: Why not just use docker import rootfs.tar br:test?

This works too, but I tend to add some adjustments to the image in the
Dockerfile. Of course, these could be added in the build process, and
probably would be better suited there.

Dockerfile:

FROM scratch

ENV container docker
ENV init /lib/systemd/systemd
ENV LC_ALL C

ADD rootfs.tar /

USER root
RUN find /etc/systemd/system \
         /usr/lib/systemd/system \
         \( -path '*.wants/*' \
         -name '*swapon*' \
         -or -name '*ntpd*' \
         -or -name '*resolved*' \
         -or -name '*udev*' \
         -or -name '*rdisc*' \
         -or -name '*freedesktop*' \
         -or -name '*persist-resize*' \
         -or -name '*NetworkManager*' \
         -or -name '*remount-fs*' \
         -or -name '*getty*' \
         -or -name '*.mount' \
         -or -name '*remote-fs*' \) \
         -exec echo \{} \; \
         -exec rm \{} \;

RUN systemctl set-default multi-user.target && \
    systemctl mask tmp.mount && \
    touch /etc/skip-skiff-mounts && \
    touch /etc/skip-skiff-journal-mounts
COPY fstab /etc/fstab

VOLUME [ "/sys/fs/cgroup", "/mnt/persist", "/mnt/rootfs" ]
ENTRYPOINT ["/usr/lib/systemd/systemd"]

Best,
Christian Stewart



More information about the buildroot mailing list