A simple build environment for Buildroot by using Docker.
Use following command to build Docker image, volumes with volume only container, and run a shell for the Buildroot.
make image volumes run
- The working directory is
/buildroot, where the Buildroot is checked out. - The default output directory
/outputand download directory/buildroot/dlare in volume only container. imagesis mounted/output/imagesto retrieve the images built.
NOTE: See
Dockerfilewhy it is using/outputinstead of default/buildroot/output.
This is an example usage to build Linux image for Linux on LiteX VexRiscv.
Run Buildroot Docker container.
$ make run ARGS='-v /path/to/linux-on-litex-vexriscv:/linux-on-litex-vexriscv'
In Docker container, run Buildroot.
$ make BR2_EXTERNAL=/linux-on-litex-vexriscv/buildroot litex_vexriscv_defconfig
$ make
It builds fw_jump.bin, Images, and rootfs.cpio, places them in
/output/images where is mounted from images also place symlinks in
/linux-on-litex-vexriscv/images where is mounted from
/path/to/linux-on-litex-vexriscv/images,
but these are pointing the locaiton in container thus replace them with
the one in images.