1. 簡介
RK3588從入門到精通系列專題
開發(fā)板:ArmSoM-W3
Kernel:5.10.160
OS:Debian11
本?介紹ArmSoM-W3在Debian11下如何安裝使用docker
2.Rockchip 平臺系統(tǒng)運行docker
Docker運行對內核配置有要求,需要 kernel 開啟 cgroups、namespace、netfilter、overlayfs 等功能的?持,這些配置打開才滿足docker運行的要求。
ArmSoM發(fā)布的普通固件一般不滿足 Docker 的運行要求,如果有需求可以用我們配置過的內核固件,或者按照下文自己配置。
2.1 kernel配置
Docker開源團隊提供了一個檢測腳本,用以檢測內核配置是否符合Docker運行的要求,下載腳本到SDK源碼kernel目錄下。
輸入如下命令:
chmod 777 check-config.sh ? ./check-config.sh .config
注意:.config需要在內核配置完后才會生成
得到如下打?。?/p>
lhd@ydtx:~/project_code/3588/3588_linux5.10_v1.0.5/kernel$ ./check-config.sh .config info: reading kernel config from .config ... ? Generally Necessary: - cgroup hierarchy: cgroupv2 Controllers: - cpu: available - cpuset: available - io: available - memory: available - pids: available - apparmor: enabled and tools installed - CONFIG_NAMESPACES: enabled - CONFIG_NET_NS: enabled - CONFIG_PID_NS: enabled - CONFIG_IPC_NS: enabled - CONFIG_UTS_NS: enabled - CONFIG_CGROUPS: enabled - CONFIG_CGROUP_CPUACCT: enabled - CONFIG_CGROUP_DEVICE: enabled - CONFIG_CGROUP_FREEZER: enabled - CONFIG_CGROUP_SCHED: enabled - CONFIG_CPUSETS: enabled - CONFIG_MEMCG: enabled - CONFIG_KEYS: enabled - CONFIG_VETH: enabled - CONFIG_BRIDGE: enabled - CONFIG_BRIDGE_NETFILTER: enabled - CONFIG_IP_NF_FILTER: enabled - CONFIG_IP_NF_TARGET_MASQUERADE: enabled - CONFIG_NETFILTER_XT_MATCH_ADDRTYPE: enabled - CONFIG_NETFILTER_XT_MATCH_CONNTRACK: enabled - CONFIG_NETFILTER_XT_MATCH_IPVS: enabled - CONFIG_NETFILTER_XT_MARK: enabled - CONFIG_IP_NF_NAT: enabled - CONFIG_NF_NAT: enabled - CONFIG_POSIX_MQUEUE: enabled - CONFIG_CGROUP_BPF: enabled ? Optional Features: - CONFIG_USER_NS: enabled - CONFIG_SECCOMP: enabled - CONFIG_SECCOMP_FILTER: enabled - CONFIG_CGROUP_PIDS: enabled - CONFIG_MEMCG_SWAP: enabled (cgroup swap accounting is currently enabled) - CONFIG_BLK_CGROUP: enabled - CONFIG_BLK_DEV_THROTTLING: missing - CONFIG_CGROUP_PERF: enabled - CONFIG_CGROUP_HUGETLB: missing - CONFIG_NET_CLS_CGROUP: enabled (as module) - CONFIG_CGROUP_NET_PRIO: missing - CONFIG_CFS_BANDWIDTH: enabled - CONFIG_FAIR_GROUP_SCHED: enabled - CONFIG_RT_GROUP_SCHED: missing - CONFIG_IP_NF_TARGET_REDIRECT: enabled (as module) - CONFIG_IP_VS: enabled - CONFIG_IP_VS_NFCT: enabled - CONFIG_IP_VS_PROTO_TCP: enabled - CONFIG_IP_VS_PROTO_UDP: enabled - CONFIG_IP_VS_RR: enabled (as module) - CONFIG_SECURITY_SELINUX: missing - CONFIG_SECURITY_APPARMOR: missing - CONFIG_EXT4_FS: enabled - CONFIG_EXT4_FS_POSIX_ACL: enabled - CONFIG_EXT4_FS_SECURITY: enabled - Network Drivers: - "overlay": - CONFIG_VXLAN: enabled (as module) - CONFIG_BRIDGE_VLAN_FILTERING: enabled Optional (for encrypted networks): - CONFIG_CRYPTO: enabled - CONFIG_CRYPTO_AEAD: enabled - CONFIG_CRYPTO_GCM: enabled - CONFIG_CRYPTO_SEQIV: enabled (as module) - CONFIG_CRYPTO_GHASH: enabled - CONFIG_XFRM: enabled - CONFIG_XFRM_USER: enabled - CONFIG_XFRM_ALGO: enabled - CONFIG_INET_ESP: enabled (as module) - "ipvlan": - CONFIG_IPVLAN: enabled (as module) - "macvlan": - CONFIG_MACVLAN: enabled (as module) - CONFIG_DUMMY: enabled (as module) - "ftp,tftp client in container": - CONFIG_NF_NAT_FTP: enabled (as module) - CONFIG_NF_CONNTRACK_FTP: enabled (as module) - CONFIG_NF_NAT_TFTP: enabled (as module) - CONFIG_NF_CONNTRACK_TFTP: enabled (as module) - Storage Drivers: - "aufs": - CONFIG_AUFS_FS: missing - "btrfs": - CONFIG_BTRFS_FS: missing - CONFIG_BTRFS_FS_POSIX_ACL: missing - "devicemapper": - CONFIG_BLK_DEV_DM: enabled (as module) - CONFIG_DM_THIN_PROVISIONING: enabled (as module) - "overlay": - CONFIG_OVERLAY_FS: enabled (as module) - "zfs": - /dev/zfs: present - zfs command: missing - zpool command: missing ? Limits: - /proc/sys/kernel/keys/root_maxkeys: 1000000
Generally Necessary是內核必須配置項,Optional Features是可選配置項
如果檢測Generally Necessary下面的結果是missing或者enabled (as module),都可以去對應配置那設置為Y。
2.2 Debian 配置
Debian 默認使? iptables-nft,? docker 默認使? iptableslegacy,故需要配置 iptables 使? legacy 版本,可以通過以下命令進?切換:
# 使? iptables-legacy update-alternatives --set iptables /usr/sbin/iptables-legacy update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy # 使? iptables-nft update-alternatives --set iptables /usr/sbin/iptables-nft update-alternatives --set ip6tables /usr/sbin/ip6tables-nft
2.3 安裝Docker
在RK3588上安裝Docker,按照以下步驟進行操作:
1.更新系統(tǒng):
在開始安裝Docker之前,確保系統(tǒng)是最新的。運行以下命令:
sudo apt update sudo apt upgrade
2.安裝依賴項:
安裝Docker所需的一些依賴項:
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
3.添加Docker官方GPG密鑰:
通過添加Docker官方的GPG密鑰來信任官方存儲庫:
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
4.設置Docker存儲庫:
添加Docker存儲庫到APT源列表中:
echo "deb [signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
5.安裝Docker引擎:
更新APT軟件包索引并安裝Docker引擎:
sudo apt update sudo apt install docker-ce docker-ce-cli containerd.io
6.啟動Docker服務:
安裝完成后,啟動Docker服務:
sudo systemctl start docker
還可以將Docker設置為在系統(tǒng)啟動時自動啟動:
sudo systemctl enable docker
7.驗證安裝:
運行以下命令以驗證Docker是否正確安裝:
sudo docker pull hello-world sudo docker run hello-world
如果一切順利,應該能夠看到hello-world容器成功運行。
-
開發(fā)板
+關注
關注
25文章
5059瀏覽量
97547 -
Docker
+關注
關注
0文章
463瀏覽量
11863 -
RK3588
+關注
關注
6文章
330瀏覽量
4358 -
Debian
+關注
關注
0文章
75瀏覽量
1186
發(fā)布評論請先 登錄
相關推薦
評論