Use the check-config.sh
script to check which configurations are missing
cd <SDK>/kernel/
cp <sourceDir>/check-config.sh .
chmod +x check-config.sh
./check-config.sh
The test results are as follows
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
......
Optional Features:
- CONFIG_USER_NS: enabled
- CONFIG_SECCOMP: enabled
- CONFIG_SECCOMP_FILTER: enabled
- CONFIG_CGROUP_PIDS: missing
- CONFIG_MEMCG_SWAP: missing
(cgroup swap accounting is currently enabled)
......
Generally Necessary: indicates necessary configuration, which is displayed as missing and needs to be enabled in the kernel configuration. Optional Features: is optional configuration, select it according to your needs.
The default system image source is Tsinghua source, and other sources can also be used, such as Alibaba Cloud, Huawei Cloud, etc. The system source file of Ubuntu is located in /etc/apt/sources.list. You can modify this file to add a mirror source. Please make sure to back it up before modifying it.
sudo apt update
apt remove docker docker-engine docker-ce docker.io
apt install -y apt-transport-https ca-certificates curl software-properties-common
Press Enter to keep the current download version
4. Use the following curl command to import the GPG key of the Docker official repository:
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
Upon success, the command returns OK.
add-apt-repository "deb [arch=arm64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu
$(lsb_release -cs) stable"
Press Enter to continue execution
6. Update apt package index again
apt update
7. Install the latest version of Docker CE
apt install docker-ce
Press Enter to keep the current download version
8. After the installation is complete, the Docker service will start automatically. To verify it type:
systemctl status docker
Found that starting docker failed
Enter dockerd to view logs and troubleshoot problems
dockerd
Press ctrl+c to exit error
9. Ubuntu 22.04 uses nftables as the firewall by default instead of iptables. Enter the following commands to resolve
sudo update-alternatives --set iptables /usr/sbin/iptables-legacy
10. Restart docker and check docker status
systemctl restart docker
systemctl status docker
11. Enter the command, and the following picture will appear, indicating that docker is installed successfully:
docker run hello-world