环境
Ubuntu 20.04 LTS
Docker 20.10.12
说明
Ubuntu
安装docker
运行时环境,参考官方文档
步骤
删除旧版本
1
| sudo apt remove docker docker-engine docker.io containerd runc
|
配置仓库
1 2 3
| sudo apt install -y ca-certificates curl gnupg lsb-release curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg 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
引擎
1 2
| sudo apt-get update sudo apt-get -y install docker-ce docker-ce-cli containerd.io
|
启动服务
1
| sudo service docker start
|
赋予当前用户docker
操作权限
1
| sudo usermod -aG docker $USER && newgrp docker
|