How to do it...

  1. 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
  1. Then, we need to add it to our conf/bblayers.conf file with the following:
$ bitbake-layers add-layer /opt/yocto/fsl-community-bsp/sources/meta-virtualization
  1. We can then checkout the 2.4 branch with the following:
$ git checkout -b rocko origin/rocko
  1. 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.
  2. The next step is to configure our distro.conf or conf/local.conf configuration file, as follows:
DISTRO_FEATURES_append = " virtualization" 
  1. We can then add some extra space to our image to download containers:
IMAGE_ROOTFS_EXTRA_SPACE = "10000" 
  1. Finally, add Docker to the image by adding the following to either the image recipe or conf/local.conf files:
IMAGE_INSTALL_append = " docker" 
  1. We can then build the image of our choice, for example:
$ bitbake core-image-minimal
  1. 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
  1. Alternatively, we can also launch a Busybox container and run the ash shell with the following command:
$ docker run -it --rm busybox sh
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset