DESK-MX6UL-AN-0006: Running Docker on Buildroot root file system

From DAVE Developer's Wiki
Jump to: navigation, search
Info Box


History
Date Version
2026/07/09 buildroot 2026.05


Introduction[edit | edit source]

By default, AXEL ULite comes with a DESK-MX6UL-L Yocto distribution. Nevertheless, other distributions can be used as well. This application note shows how to run one of them, Buildroot.

Buildroot is known to be very simple to configure and build. An exhaustive discussion of Buildroot is beyond the scope of this application note. The interested reader can refer for example to this presentation which compares in detail Yocto and Buildroot.

The test bed used for this application note is composed of the same hardware/software platform delivered along with the DESK-MX6UL-L. About Buildroot, the version buildroot-2026.05 was used.

Virtual Machine requirements[edit | edit source]

The building process may require higher resources than the original DESK-MX6UL-L MVM settings: this depends on the package selected in the .config file and their build resources.

MVM with 4 CPU cores and 16GB of RAM

Downloading, configuring and building[edit | edit source]

This process is straightforward. Once the file buildroot-2026.05.tar.gz is downloaded and decompressed on your Linux host machine, get into the Buildroot directory, and run make menuconfig.

Buildroot make menuconfig

Then enter the Target options menu and select:

  • ARM (little endian) for Target Architecture
  • cortex-A7 for Target Architecture Variant

as shown in the following picture.

Buildroot make menuconfig


Another important configuration is the Freescale i.MX Libraries settings (Target packages ? Hardware handling ? Freescale i.MX libraries) for i.MX6UL processor and its imx-tools (imx-codec, imx-kobs, firmware)

i.MX libraries


That's it: after saving your configuration and exiting menuconfig, you can start the build process by simply issuing the make command.

For your sake of convenience, the created .config file can be downloaded from here (rename it as .config).

Linux kernel[edit | edit source]

The latest Linux kernel version provided in the DAVE' git repositories can be used for building the kernel image too.

It's possible that your kernel is still missing modules that are required for docker to function properly; you can try running below script to see what’s missing: https://github.com/docker/docker/blob/master/contrib/check-config.sh

After modification of the kernel configuration, it is possible to use the script to check your kernel configuration file, see if there is missing on the general necessary options.

chmod +x check-config.sh
dos2unix check-config.sh

The defconfig file imx_v7_desk_docker_defconfig, used for running docker in this Application Note, can be found here

The kernel tarball can be copied into the proper Buildroot directory:

Linux kernel tarball and using Docker defconfig

Also, the related device tree will be built and both artifacts installed into /boot root file system directory

Package list[edit | edit source]

The root file system package composition has been created for a list of packages commonly used to create a root file system good for running Docker.

Below is a list of the most important selected packages:

  • docker: docker-engine, docker-compose and docker-cli
  • python: python3 with python-docker module
  • web server: lighttpd
  • database: sqlite3 (with python3 module)
  • network applications: mosquitto, iw, ntp, openssh, openvpn, tailscale, vsftpd, wget
  • package managers: opkg, rpm

Build the targets[edit | edit source]

It is enough to run the make command and buildroot will start building the toolchain and then cross-compiling the selected packages.

Once the build process has been completed, the output/images directory will contain the binary artifacts:

dvdk@vagrant:~/buildroot$ ls -la output/images/
total 672052                                                                                                         
drwxr-xr-x 2 dvdk dvdk      4096 Jun 30 05:10 .                                                                      
drwxrwxr-x 6 dvdk dvdk      4096 Jun 30 05:12 ..                                                                     
-rwxr-xr-x 1 dvdk dvdk     33313 Jun 30 05:05 imx6ul-axelulite-cb003a.dtb                                            
-rwxr-xr-x 1 dvdk dvdk     33956 Jun 30 05:05 imx6ul-lynx-som0022-cb0090.dtb                                         
-rw-r--r-- 1 dvdk dvdk 508876800 Jun 30 05:10 rootfs.tar                                                          
-rw-r--r-- 1 dvdk dvdk 167740401 Jun 30 05:12 rootfs.tar.bz2                                                                                                         
-rw-r--r-- 1 dvdk dvdk  11472496 Jun 30 05:05 uImage                                                                                                                       
dvdk@vagrant:~/buildroot$    

If the SDK is required for building the application in the building environment, it is possible to generate the SDK using:

make sdk

and this will produce:

dvdk@vagrant:~/buildroot$ ls -la output/images/*sdk* 
-rw-r--r-- 1 dvdk dvdk 1685597706 Jul  9 12:38 output/images/arm-buildroot-linux-gnueabihf_sdk-buildroot.tar.gz
dvdk@vagrant:~/buildroot$ 

Buildroot file system on the target[edit | edit source]

The created root file system can be extracted in a Virtual Machine local directory that can be used for starting the rfs via nfs:

dvdk@vagrant:~/buildroot$ mkdir rfs && cd rfs
dvdk@vagrant:~/buildroot/rfs$ sudo tar jxpf ../buildroot/output/images/rootfs.tar.bz2
dvdk@vagrant:~/buildroot/rfs$ 

Starting the root file system in the target will welcome you with the classic prompt:

...
...
Starting ntpd: OK
Starting crond: OK
Starting lighttpd: OK
Starting mosquitto: OK
Starting sshd: OK
Starting dockerd: OK
Starting vsftpd: OK
Starting swupdate: OK
Starting collectd: OK
Starting httpd: OK

Welcome to Buildroot 2026.05 for AXEL ULite
buildroot login: root
root@buildroot:/root# cat /etc/os-release
NAME=Buildroot
VERSION=2026.05-6-g09b4a21c96
ID=buildroot
VERSION_ID=2026.05
PRETTY_NAME="Buildroot 2026.05"
root@buildroot:/root#

Running Docker on the target[edit | edit source]

As a docker platform test, the standard hello-world (info on Docker Hub container library here) can be used:

root@buildroot:/# docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
8593da9e4aa9: Pull complete
Digest: sha256:96498ffd522e70807ab6384a5c0485a79b9c7c08ca79ba08623edcad1054e62d
Status: Downloaded newer image for hello-world:latest
[  590.944429] docker0: port 1(vethcc24fe3) entered blocking state
[  590.950674] docker0: port 1(vethcc24fe3) entered disabled state
[  590.958536] vethcc24fe3: entered allmulticast mode
[  590.964568] vethcc24fe3: entered promiscuous mode
[  591.927260] eth0: renamed from veth21895d3
[  591.993280] docker0: port 1(vethcc24fe3) entered blocking state
[  591.999274] docker0: port 1(vethcc24fe3) entered forwarding state

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (arm32v7)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/

[  594.375714] veth21895d3: renamed from eth0
[  594.405251] docker0: port 1(vethcc24fe3) entered disabled state
[  594.561029] docker0: port 1(vethcc24fe3) entered disabled state
[  594.569128] vethcc24fe3 (unregistering): left allmulticast mode
[  594.576111] vethcc24fe3 (unregistering): left promiscuous mode
[  594.582009] docker0: port 1(vethcc24fe3) entered disabled state
root@buildroot:/#

and also the Ubuntu bash docker image can be run in the target:

root@buildroot:/root# docker run -it ubuntu bash
Unable to find image 'ubuntu:latest' locally
latest: Pulling from library/ubuntu
3afcfc6322f1: Pull complete
c279c504cbdc: Pull complete
Digest: sha256:53958ec7b67c2c9355df922dd08dbf0360611f8c3cdb656875e81873db9ffdba
Status: Downloaded newer image for ubuntu:latest
[  321.764432] docker0: port 2(veth4082375) entered blocking state
[  321.772262] docker0: port 2(veth4082375) entered disabled state
[  321.783391] veth4082375: entered allmulticast mode
[  321.789848] veth4082375: entered promiscuous mode
[  322.481212] eth0: renamed from veth63f5cbf
[  322.553207] docker0: port 2(veth4082375) entered blocking state
[  322.559269] docker0: port 2(veth4082375) entered forwarding state
root@8f85e2765541:/# cat /etc/os-release
PRETTY_NAME="Ubuntu 26.04 LTS"
NAME="Ubuntu"
VERSION_ID="26.04"
VERSION="26.04 LTS (Resolute Raccoon)"
VERSION_CODENAME=resolute
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=resolute
LOGO=ubuntu-logo
root@8f85e2765541:/#

Binary artifacts[edit | edit source]

buildroot binary artifacts (root file system, kernel+dtb and SDK) can be downloaded from DAVE Embedded Systems cloud server

N.B. config file should be renamed as .config in the buildroot directory before starting the build process