一、docker安装
Docker 官方文档 | Docker Documentation
1.自动安装
wget http://fishros.com/install -O fishros && sudo bash fishros
2.手动安装
2.1. ubuntu安装
1.系统需求
- Ubuntu Jammy 22.04 (LTS)
- Ubuntu Impish 21.10
- Ubuntu Focal 20.04 (LTS)
- Ubuntu Bionic 18.04 (LTS)
Docker Engine is supported on x86_64
(or amd64
), armhf
, arm64
, and s390x
architectures.
2.卸载旧版本
sudo apt-get remove docker docker-engine docker.io containerd runc
3.使用仓库安装(也可以使用二进制包安装)
sudo apt-get update
sudo apt-get install \
ca-certificates \
curl \
gnupg \
lsb-release
4.添加 GPG key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
5.添加docker源
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
-
安装 Docker Engine
#安装最新docker
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
#安装指定版本
apt-cache madison docker-ce
udo apt-get install docker-ce=<VERSION_STRING> docker-ce-cli=<VERSION_STRING> containerd.io docker-compose-plugin
7.测试
docker version
sudo docker run hello-world