Docker安装

Docker安装

Ubuntu系统中安装Docker

1、卸载旧版本

sudo apt-get remove docker docker-engine docker.io containerd runc

2、更新apt包管理索引

sudo apt-get update
 sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg \
    lsb-release

3、添加Docker官方GPG密钥

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

4、设置稳定仓库

 echo \
  "deb [arch=amd64 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

5、安装Docker

sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io

6、验证Docker是否安装成功

sudo docker run hello-world

7、将普通用户添加到docker组

sudo gpasswd -a 用户 docker
上一篇:GPG Suite mac版如何导入公钥?


下一篇:有关kali更新源时出现的GPG数字证书无效提示的解决方法