Docker installation requires specific Linux system versions. Check supported system versions on the Docker installation help page.
Basic requirements are as follows:
Linux kernel version: 3.0 or later versions; CentOS version: 7 or later versions or Ubuntu version: 20 or later versions
For details about how to install Docker on Windows systems, refer to https://learn.microsoft.com/en-us/virtualization/windowscontainers/quick-start/set-up-environment?tabs=dockerce.
(1) Check the system version by the command cat /etc/os-release.
(2) If the system version does not meet the requirements, upgrade Linus to a Docker-supported system version.
(1) If Docker has already been installed, uninstall it first by the following command:
yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine
For systems without Docker installed, run the commands shown in the following figure.
(2) Install the yum utility package and storage driver by the command yum install -y yum-utils.
(3) Set the image repository by the following command:
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
(4) Update the yum repository metadata by the command yum makecache fast.
(5) Install Docker. docker-ce is the community edition, while docker-ee is the enterprise edition. Just use the community edition here.
yum install docker-ce docker-ce-cli containerd.io
Enter y to confirm the download, as shown in the following figure.
Enter y to confirm the installation, as shown in the following figure.
(6) Start Docker by the command systemctl start docker.
1. Update the system software package.
sudo apt update
2. Install dependency packages.
sudo apt install apt-transport-https ca-certificates curl software-properties-common
3. Add the official Docker GPG private key by executing the following commands sequentially:
sudo -icurl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | gpg --dearmor -o/etc/apt/trusted.gpg.d/docker-ce.gpgcurl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpgchmod a+r /etc/apt/trusted.gpg.d/docker-ce.gpgchmod a+r /usr/share/keyrings/docker-archive-keyring.gpgecho "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
4. Perform verification. 0EBFCD88 is the public key fingerprint. After executing the command, the system will display the public key information related to this fingerprint.
sudo apt-key fingerprint 0EBFCD88
5. Add the Docker repository.
sudo add-apt-repository "deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
6. Update the software package again.
7. Install Docker of the latest version by default.
sudo apt install docker-ce docker-ce-cli containerd.io
8. Check whether Docker is successfully installed. Docker starts automatically after installation. If the version is displayed, Docker has been successfully installed.
sudo docker --version
滑鼠選中內容,快速回饋問題
滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。
不再提示
10s後關閉
Submitted successfully
Network busy