Skip to main content

Docker Developer Guide

:::info 文档信息

文档标识:RK-KF-YF-334 · 发布版本:V1.1.0 · 发布日期:2021-07-19 · 页数:6 · 语言:英文

原始文档:Rockchip_Developer_Guide_Debian_Docker_EN.pdf

:::

章节大纲​

  • Docker Developer Guide(P1)
    • Rockchip Docker(P4)
    • OS requirements(P4)
      • Install Docker(P4)
      • Build application(P5)
      • Modify image(P5)
    • Others(P5)
    • Examples(P5)

在线预览​

若预览无法显示,请直接下载 PDF 后用本地阅读器打开。


1. Rockchip Docker​

Docker is a tool designed to make it easier to create, deploy, and run applications by using containers. Containers

allow a developer to package up an application with all of the parts it needs, such as libraries and other dependencies, and ship it all out as one package. By doing so, thanks to the container, the developer can rest assured that the application will run on any other Linux machine regardless of any customized settings that machine might have that could differ from the machine used for writing and testing the code.

In a way, Docker is a bit like a virtual machine. But unlike a virtual machine, rather than creating a whole virtual operating system, Docker allows applications to use the same Linux kernel as the system that they're running on and only requires applications be shipped with things not already running on the host computer. This gives a significant performance boost and reduces the size of the application.

And importantly, Docker is open source. This means that anyone can contribute to Docker and extend it to meet their own needs if they need additional features that aren't available out of the box.

The Rockchip Docker open source is on

docker-rockchip.

2. OS requirements​

To install Docker, you need the 64-bit version of one of these Ubuntu versions:

Focal 20.04 (LTS) Bionic 18.04 (LTS) Xenial 16.04 (LTS) Trusty 14.04 (LTS)

Note: the dockerfile is used for arm64 socs by default.

Below is used for arm32 Socs: cp dockerfile-32 dockerfile

2.1 Install Docker​

Use this command to install the latest version of Docker(replace docker with docker.io in ubuntu 14.04):

sudo apt-get install docker qemu-user-static binfmt-support

Start run Docker deamon:

sudo service docker start

Build Docker image by dockerfile:

sudo docker build -t rockchip .

Now you get a Docker image named "rockchip" which include a debian multiarch cross-compiling enviroment.

2.2 Build application​

Enter docker shell:

docker run -it -v <package dir>:/home/rk/packages rockchip /bin/bash

Start build:

for arm 32-bit Socs:

cd /home/rk/packages/<package-name>
DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -rfakeroot -b -d -uc -us -aarmhf
ls ../ | grep *.deb

for arm 64-bit Socs:

cd /home/rk/packages/<package-name>
DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -rfakeroot -b -d -uc -us -aarm64
ls ../ | grep *.deb

2.3 Modify image​

If you want to modify your Docker image, you can open a shell by below command:

docker run -it rockchip /bin/bash

After exit from container, you should use below command to save your changes.

docker commit <container_id> rockchip

3. Others​

To get more informations about dockers, please check below link: https://docs.docker.com

4. Examples​

How to generate the libmali-bifrost-g52-g2p0-x11_1.9-1_arm64.deb on libmali

wxt@nb:~/work/docker/docker-rockchip$sudo service docker start
wxt@nb:~/work/docker/docker-rockchip$sudo docker build -t rockchip .
wxt@nb:~/work/docker/docker-rockchip$sudo docker run -it -v
/home/wxt/work:/home/rk/packages rockchip /bin/bash
rk@2888134f9c12:/$ cd /home/rk/packages/docker/libmali
rk@2888134f9c12:~/packages/docker/libmali$ DEB_BUILD_OPTIONS=nocheck dpkg-
buildpackage -rfakeroot -b -d -uc -us -aarm64

The above steps will get the debs for ~/packages/docker/

Rockchip had uploaded some source code for building and generating the deb packages

glmark2 libdrm libdrm-cursor libmali mpp libv4l-rkmpp openbox rga xserver gstreamer-rockchip