VisionFive 2单板计算机成功支持Docker容器解决方案

引言

Linux各种版本繁多,迭代频繁,不同版本之间难以兼容,给系统运维人员带来重重困难。有幸的是,Docker的迅速发展给这些问题提供了一个标准化的解决方案。

Docker是一个开源的应用容器引擎,开发者可以利用它打包应用和依赖包到一个轻量级、可移植的容器中,然后发布到任何版本的Linux设备上,能够更高效的利用系统资源、保证一致的运行环境,实现持续交付和部署,以及后期更轻松的迁移、维护、扩展。

近日,赛昉科技成功在 VisionFive 2 开发板上成功支持Docker容器解决方案,这是赛昉科技推动 RISC-V生态演进的一大进展。

Docker使用流程介绍

赛昉科技提供了以下应用指南,该文档详细介绍了如何在VisionFive 2 单板计算机上使用Docker容器解决方案。

《在昉·星光 2上运行Docker》:点击此链接阅读

如需更多详细信息,请参照本文末尾的联系方式,联系赛昉科技进一步获取。

关于 VisionFive 2

VisionFive 2 是全球第一款集成 3D GPU 的高性能量产 RISC-V 单板计算机,它优越的性能与合理的价格使其成为更加普惠的 RISC-V 开发板。与上一代相比,VisionFive 2 在细节上进行了全面升级:

处理器配备赛昉科技推出的 JH7110,具有更加强大的 GPU 处理能力和多媒体支持能力,搭载 64 位高性能四核 RISC-V CPU,稳定工作频率可高达 1.5GHz。板载的 Imagination BXE-4-32 GPU,支持 OpenGL ES、OpenCL、Vulkan 等。

拥有丰富的外设接口,包括 HDMI,MIPI,USB3.0/2.0,两个 GbE 以太网接口等,同时还提供 M.2 连接器、eMMC 插座、40 针 GPIO 头等丰富的 I/O 外围设备,Type-C 接口支持 USB PD 供电。

VisionFive 2 正面视图

关于赛昉科技

赛昉科技(StarFive)成立于2018年,是一家具有独立自主知识产权的本土高科技企业,提供全球领先的基于RISC-V指令集的CPUIP、SoC、开发板等系列产品和解决方案,是中国RISC-V软硬件生态的领导者。

成立至今,赛昉科技已相继推出了多款基于RISC-V的产品:全球性能最高、支持指令最全的处理器内核昉·天枢,全球首款量产的高性能多媒体处理器昉·惊鸿7110,全球性能最高的量产单板计算机昉·星光2。

这些产品覆盖了云电脑、平板电脑、台式/笔记本计算机、网关路由、边缘计算、工业显示、智慧家庭、智慧零售、智慧能源等设备、场景和行业。

赛昉科技扎根中国,放眼世界,矢志于成为全球RISC-V技术和生态的推动者和领导者。未来,赛昉科技将继续加强与供应商、分销商、软件开发商、解决方案服务商、开源社区、科研机构、高校等伙伴的全方位合作,通过引领RISC-V技术的发展,驱动产业创新,进而使得RISC-V进入更多高性能应用领域,为全球开发者及客户创造更大的价值。

联系我们

技术文档:https://doc.rvspace.org/ Tech Doc: https://doc-en.rvspace.org/

交流社区:https://rvspace.org/

公司官网:https://www.starfivetech.com/

销售联系:sales@starfivetech.com

021-50478300

其他联系:marketing@starfivetech.com

build_kernel_vf2.sh (698 Bytes)

docker_config_final_20230215 (150.6 KB)

1 Like

参考上面的链接,一路操作下来,非常顺畅, 成功在昉·星光 2上启动Docker, 有了Docker,可以在上面做很多事情呀 :+1: :+1: :+1:

debian镜像无法运行docker

sudo apt install docker.io
user@starfive ~> sudo systemctl start docker
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xeu docker.service" for details.

:sweat_smile:
那个……提示信息里面说了的事情,能不能照做一下。
真正的错误信息需要这两个命令给出来。

PS:我印象里 debian 对于 docker 的支持不是太好,弄起来很麻烦。如果真有 docker 的需求,似乎还是用 Fedora 的 riscv 版更好一些。当然,这样驱动是问题了。
如果没有特殊需求,仅仅是需要一个容器,似乎 systemd 的那个 nspawn 相对来说环境需求最低吧。systemd 自己的东西,需要的东西,只要是基于 systemd 启动的系统都已经有了。

user@starfive ~> sudo systemctl start docker
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xeu docker.service" for details.
user@starfive ~ [1]> systemctl status docker
× docker.service - Docker Application Container Engine
     Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Fri 2024-02-16 12:10:49 UTC; 27s ago
TriggeredBy: × docker.socket
       Docs: https://docs.docker.com
    Process: 3517 ExecStart=/usr/sbin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock $DOCKER_OPTS (code=exited, status=1/FAILURE)
   Main PID: 3517 (code=exited, status=1/FAILURE)
        CPU: 446ms

Feb 16 12:10:49 starfive systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
Feb 16 12:10:49 starfive systemd[1]: Stopped Docker Application Container Engine.
Feb 16 12:10:49 starfive systemd[1]: docker.service: Start request repeated too quickly.
Feb 16 12:10:49 starfive systemd[1]: docker.service: Failed with result 'exit-code'.
Feb 16 12:10:49 starfive systemd[1]: Failed to start Docker Application Container Engine.
Feb 16 12:11:12 starfive systemd[1]: docker.service: Start request repeated too quickly.
Feb 16 12:11:12 starfive systemd[1]: docker.service: Failed with result 'exit-code'.
Feb 16 12:11:12 starfive systemd[1]: Failed to start Docker Application Container Engine.
user@starfive ~ [3]> journalctl -xeu docker.service
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░ 
░░ A start job for unit docker.service has finished with a failure.
░░ 
░░ The job identifier is 2491 and the job result is failed.
Feb 16 12:10:49 starfive systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
░░ Subject: Automatic restarting of a unit has been scheduled
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░ 
░░ Automatic restarting of the unit docker.service has been scheduled, as the result for
░░ the configured Restart= setting for the unit.
Feb 16 12:10:49 starfive systemd[1]: Stopped Docker Application Container Engine.
░░ Subject: A stop job for unit docker.service has finished
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░ 
░░ A stop job for unit docker.service has finished.
░░ 
░░ The job identifier is 2567 and the job result is done.
Feb 16 12:10:49 starfive systemd[1]: docker.service: Start request repeated too quickly.
Feb 16 12:10:49 starfive systemd[1]: docker.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░ 
░░ The unit docker.service has entered the 'failed' state with result 'exit-code'.
Feb 16 12:10:49 starfive systemd[1]: Failed to start Docker Application Container Engine.
░░ Subject: A start job for unit docker.service has failed
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░ 
░░ A start job for unit docker.service has finished with a failure.
░░ 
░░ The job identifier is 2567 and the job result is failed.
Feb 16 12:11:12 starfive systemd[1]: docker.service: Start request repeated too quickly.
Feb 16 12:11:12 starfive systemd[1]: docker.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░ 
░░ The unit docker.service has entered the 'failed' state with result 'exit-code'.
Feb 16 12:11:12 starfive systemd[1]: Failed to start Docker Application Container Engine.
░░ Subject: A start job for unit docker.service has failed
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░ 
░░ A start job for unit docker.service has finished with a failure.
░░ 
░░ The job identifier is 2643 and the job result is failed.
user@starfive ~> 

:sweat_smile:
不好的消息,docker 服务启动失败。但是你贴出来的这两个命令的输出,里面也没有详细写启动失败的原因。

你试试手动运行一下 ExecStart 后面的命令试试看有没有有用的提示信息。

PS:别忘了确认 $DOCKER_OPTS 变量内容。

user@starfive ~> sudo /usr/sbin/dockerd
INFO[2024-02-17T14:56:33.580987509Z] Starting up                                  
INFO[2024-02-17T14:56:33.588323369Z] parsed scheme: "unix"                         module=grpc
INFO[2024-02-17T14:56:33.588449370Z] scheme "unix" not registered, fallback to default scheme  module=grpc
INFO[2024-02-17T14:56:33.588585622Z] ccResolverWrapper: sending update to cc: {[{unix:///run/containerd/containerd.sock  <nil> 0 <nil>}] <nil> <nil>}  module=grpc
INFO[2024-02-17T14:56:33.588652623Z] ClientConn switching balancer to "pick_first"  module=grpc
INFO[2024-02-17T14:56:33.600687803Z] parsed scheme: "unix"                         module=grpc
INFO[2024-02-17T14:56:33.600827055Z] scheme "unix" not registered, fallback to default scheme  module=grpc
INFO[2024-02-17T14:56:33.600933307Z] ccResolverWrapper: sending update to cc: {[{unix:///run/containerd/containerd.sock  <nil> 0 <nil>}] <nil> <nil>}  module=grpc
INFO[2024-02-17T14:56:33.601021558Z] ClientConn switching balancer to "pick_first"  module=grpc
INFO[2024-02-17T14:56:34.433557490Z] [graphdriver] using prior storage driver: overlay2 
WARN[2024-02-17T14:56:34.440214340Z] Unable to find memory controller             
WARN[2024-02-17T14:56:34.440274591Z] Unable to find io controller                 
WARN[2024-02-17T14:56:34.440318091Z] Unable to find cpuset controller             
WARN[2024-02-17T14:56:34.440351342Z] Unable to find pids controller               
INFO[2024-02-17T14:56:34.441100603Z] Loading containers: start.                   
WARN[2024-02-17T14:56:34.459930384Z] Running modprobe bridge br_netfilter failed with message: modprobe: WARNING: Module bridge not found in directory /lib/modules/5.15.0-starfive
modprobe: WARNING: Module br_netfilter not found in directory /lib/modules/5.15.0-starfive
, error: exit status 1 
INFO[2024-02-17T14:56:34.844248124Z] stopping event stream following graceful shutdown  error="<nil>" module=libcontainerd namespace=moby
failed to start daemon: Error initializing network controller: error obtaining controller instance: unable to add return rule in DOCKER-ISOLATION-STAGE-1 chain:  (iptables failed: iptables --wait -A DOCKER-ISOLATION-STAGE-1 -j RETURN: iptables v1.8.8 (nf_tables):  RULE_APPEND failed (No such file or directory): rule in chain DOCKER-ISOLATION-STAGE-1
 (exit status 4))

应该iptables的问题或缺包

这个输出里面的错误是内核问题,没有找到 br_netfilter 模块。
VF2 官方的内核开的模块非常少,建议自己按需重新配置个新的。

建议换 VF2 的 6.1 系列内核,github 上面有: GitHub - starfive-tech/linux

PS:你运行的命令不全,要包括参数一起。

1 Like

噢,谢谢,我去试试