Server is a low profile of Tencent Cloud. It has been stale for a long time. Only the api of the bus was released. Recently it was hacked. , I reinstalled the system, and kept it, I plan to use it to learn docker.
1. Update system software
sudo apt-get update
2. Install dependencies
sudo apt-get install \
apt-transport-https \ ca-certificates \ curl \ gnupg-agent \
software-properties-common
3. Download and install the secret key, choose one of them
# Official source
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# University of Science and Technology
$ curl -fsSL https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
# Tsinghuayuan
$ curl -fsSL https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
# Check if the key is installed successfully
$ sudo apt-key fingerprint 0EBFCD88
4. Add the software source for installing docker. If you think the official source is slow, you can choose the source of the University of Science and Technology and the source of Tsinghua
I did not set the source before, which caused the installation to fail. Here you can choose the source of Zhongke University or Tsinghua source
# University of Science and Technology
$ sudo add-apt-repository \
" deb [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu \
$(lsb_release -cs) \ stable"
# Tsinghuayuan$ sudo add-apt-repository \
" deb [arch=amd64] https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/ubuntu \
$(lsb_release -cs) \ stable"
5. Install docker-ce
sudo apt install docker-ce
At this point, the installation is complete.
For more high-quality content, please pay attention to [Youth Coder]
Recommended Posts