Docker container for Buildroot building¶
Preface¶
This is a Docker container for Buildroot building. It was created to support the Firefly Open Source Project. We install the required dependencies and make the development environment based on Ubuntu 16.04 LTS.
It currently only supports to ROC-RK3308-CC Buildroot SDK.
Install Docker CE¶
To install Docker CE, you need the 64-bit version of one of these Ubuntu versions:
Bionic 18.04 (LTS)
Xenial 16.04 (LTS)
Trusty 14.04 (LTS) (older than Docker CE v18.06)
You can refer to “Get Docker CE for Ubuntu” to install Docker CE.
The Automatic tool: DKCook¶
DKCook
is a hell script programming, put at FFTools/DockerCook/
.
If you can’t find FFTools, please update the SDK.
DKCook
default use a docker image tchip/buildroot-builder
,it will automatically download the buildroot-builder from Docker Hub.
To build the SDK, you can add ./FFTools/DockerCook/DKCook
in front of the building command. As below:
Building the whole SDK:
$ cd SDK/
$ ./FFTools/DockerCook/DKCook ./build.sh
Building kernel:
$ cd SDK/
$ ./FFTools/DockerCook/DKCook ./build.sh kernel
Or building kernel step by step:
$ cd SDK/kernel/
$ ../FFTools/DockerCook/DKCook make arch=arm64 firefly-rk3308_linux_defconfig
$ ../FFTools/DockerCook/DKCook make arch=arm64 rk3308-roc-cc-dmic-pdm_emmc.img
Also,you can run bash into container,by command:
$ cd SDK/
$ ./FFTools/DockerCook/DKCook --run
NOTE
If you have build the SDK on PC, and want to do it in container instead. Or the opposite. You must rebuild the whole SDK with new environment(rm SDK/buildroot/output/
directory), to avoid some misstake.
Advanced¶
If you are familiar with Docker, you can customize the Docker operation by referring to the following.
Docker image from¶
There are two ways to get Docker image:
Generating a Docker image by
Dockerfile
Get the docker image from Docker Hub
Generating the Docker image¶
Github for Dockerfile: https://github.com/T-Firefly/buildroot-builder
Get the project:
$ git clone https://github.com/T-Firefly/buildroot-builder.git
Run commands:
$ cd DockerCook/
$ docker build -t buildroot-builder .
Download the Docker image¶
You can download the docker image from Docker Hub , search for tchip/buildroot-builder
.
Run commands:
$ docker pull tchip/buildroot-builder:latest
Command line¶
The container default working directory is /home/project, it is also a mountpoint that can be used to mount your current working directory into the container, like:
docker run -it --rm \
-e USER_ID=$UID \
--mount type=bind,source="$PWD",target="/home/project" \
buildroot-builder \
/bin/bash
Run bash into container, to build the SDK refer to “Building System Firmware”.