The Docker application is provided by the meta-virtualization layer, so we first need to clone it into our FSL community BSP installation with the following code:
$ cd /opt/yocto/fsl-community-bsp/sources/ $ git clone git://git.yoctoproject.org/meta-virtualization
Then, we need to add it to our conf/bblayers.conf file with the following:
We can then checkout the 2.4 branch with the following:
$ git checkout -b rocko origin/rocko
In the same way, we need to add the meta-networking, meta-filesystems and meta-python layers from meta-openembedded as dependencies, also on the Rocko branch.
The next step is to configure our distro.conf or conf/local.conf configuration file, as follows:
DISTRO_FEATURES_append = " virtualization"
We can then add some extra space to our image to download containers:
IMAGE_ROOTFS_EXTRA_SPACE = "10000"
Finally, add Docker to the image by adding the following to either the image recipe or conf/local.conf files:
IMAGE_INSTALL_append = " docker"
We can then build the image of our choice, for example:
$ bitbake core-image-minimal
Once the build is finished and the images are programmed, we can test Docker by running a hello-world container, as follows:
$ docker run hello-world
Alternatively, we can also launch a Busybox container and run the ash shell with the following command: