[Buildroot] [PATCH v2] configs/docker_*: add build config for docker images

rknecht at pm.me rknecht at pm.me
Mon Jun 6 18:34:53 UTC 2022


Hi Arnout,

On Monday, June 6th, 2022 at 14:50, Arnout Vandecappelle <arnout at mind.be> wrote:
>
>
> Hi Roger,
>
> On 04/06/2022 14:45, Roger Knecht via buildroot wrote:
>
> > Buildroot is not only great to build embedded systems but also to
> > create minimal docker images. Adding a default configuration for
> > docker images makes it easier to use.
>
>
> Thank you for your contribution. However, I feel it adds little to no value.
> The docker configurations are absolutely trivial, and they also don't add any
> testing surface.
Thank you for reviewing the patch.

> This compared to other boards, which find a combination of
> bootloader, kernel and image generation options that actually work, and which
> actually does add to the testing surface since the build of the kernel or
> bootloader sometimes breaks with newer toolchains or host OSes.
Is it a requirement for defconfigs to add test surface in order to be accepted?

Containers run on the host kernel so this patch cannot add test surface for
bootloader, kernel and image generation options.

I think it is better to compare the Docker defconfigs to QEMU instead of real
boards. If the bootloader, kernel and image generation settings are removed
from the QEMU defconfigs it results in a similar trivial config.

The simplicity of the config also follows the buildroot manual:
  "the configuration should be as minimal as possible, and should only build a
   working basic BusyBox system for the target platform"

>
> I've discussed with other maintainers, and they share this opinion.
>
> Therefore, I marked the patch as Changes Requested in patchwork.
I see the following options to add more value to the patch:

  1. Add a post-image.sh + Kconfig options to set the Docker image name and tags.
     The post-image.sh will then automatically load rootfs.tar as Docker image.
     This avoids running
       `docker image import output/images/rootfs.tar <image name>:<image tag>`
     after every build.

  2. post-image.sh will generate a start-docker.sh (similar to start-qemu.sh)
     which can used to run the Docker container. This avoids calling manually
       `docker run --rm -it <image name>:<image tag> /bin/sh`

Let me know if you have any other suggestions to bring more value to the patch.

Despite the trivial changes it may add the following value:
  - Faster full image builds for development
    Container images do not require building the kernel and bootloader. Therefore a
    full rebuild is faster. This may be useful for quick tests on target package changes.

  - Extend buildroot's user base beyond embedded systems
    If buildroot has an easy way to build container images it may attract more users outside
    the embedded world.

  - The run-time testing framework may run faster in a container than in QEMU (I didn't further
    investigate in that direction)

If this does not add enough value I have no hard feelings to drop the patch.

Thanks,
Roger



More information about the buildroot mailing list