1. 簡(jiǎn)介
RK3588從入門到精通系列專題
開(kāi)發(fā)板:ArmSoM-W3
Kernel:5.10.160
OS:Debian11
本?介紹ArmSoM-W3在Debian11下如何安裝使用docker
2.Rockchip 平臺(tái)系統(tǒng)運(yùn)行docker
Docker運(yùn)行對(duì)內(nèi)核配置有要求,需要 kernel 開(kāi)啟 cgroups、namespace、netfilter、overlayfs 等功能的?持,這些配置打開(kāi)才滿足docker運(yùn)行的要求。
ArmSoM發(fā)布的普通固件一般不滿足 Docker 的運(yùn)行要求,如果有需求可以用我們配置過(guò)的內(nèi)核固件,或者按照下文自己配置。
2.1 kernel配置
Docker開(kāi)源團(tuán)隊(duì)提供了一個(gè)檢測(cè)腳本,用以檢測(cè)內(nèi)核配置是否符合Docker運(yùn)行的要求,下載腳本到SDK源碼kernel目錄下。
輸入如下命令:
chmod 777 check-config.sh ? ./check-config.sh .config
注意:.config需要在內(nèi)核配置完后才會(huì)生成
得到如下打印:
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是內(nèi)核必須配置項(xiàng),Optional Features是可選配置項(xiàng)
如果檢測(cè)Generally Necessary下面的結(jié)果是missing或者enabled (as module),都可以去對(duì)應(yīng)配置那設(shè)置為Y。
2.2 Debian 配置
Debian 默認(rèn)使? iptables-nft,? docker 默認(rèn)使? iptableslegacy,故需要配置 iptables 使? legacy 版本,可以通過(guò)以下命令進(jìn)?切換:
# 使? 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,按照以下步驟進(jìn)行操作:
1.更新系統(tǒng):
在開(kāi)始安裝Docker之前,確保系統(tǒng)是最新的。運(yùn)行以下命令:
sudo apt update sudo apt upgrade
2.安裝依賴項(xiàng):
安裝Docker所需的一些依賴項(xiàng):
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
3.添加Docker官方GPG密鑰:
通過(guò)添加Docker官方的GPG密鑰來(lái)信任官方存儲(chǔ)庫(kù):
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
4.設(shè)置Docker存儲(chǔ)庫(kù):
添加Docker存儲(chǔ)庫(kù)到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.啟動(dòng)Docker服務(wù):
安裝完成后,啟動(dòng)Docker服務(wù):
sudo systemctl start docker
還可以將Docker設(shè)置為在系統(tǒng)啟動(dòng)時(shí)自動(dòng)啟動(dòng):
sudo systemctl enable docker
7.驗(yàn)證安裝:
運(yùn)行以下命令以驗(yàn)證Docker是否正確安裝:
sudo docker pull hello-world sudo docker run hello-world
如果一切順利,應(yīng)該能夠看到hello-world容器成功運(yùn)行。
-
開(kāi)發(fā)板
+關(guān)注
關(guān)注
25文章
4896瀏覽量
97059 -
Docker
+關(guān)注
關(guān)注
0文章
453瀏覽量
11792 -
RK3588
+關(guān)注
關(guān)注
6文章
303瀏覽量
4144 -
Debian
+關(guān)注
關(guān)注
0文章
74瀏覽量
1127
發(fā)布評(píng)論請(qǐng)先 登錄
相關(guān)推薦
評(píng)論