Ubuntu安装docker
内容纲要
- 更新apt包资源索引,安装软件包以允许apt通过HTTPS使用存储库:
sudo apt-get update sudo apt-get install \ apt-transport-https \ ca-certificates \ curl \ gnupg-agent \ software-properties-common
- 添加Docker官方GPG key
#curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - #使用阿里云版 ,使用root用户执行 curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | apt-key add -
- 验证key的指纹:
sudo apt-key fingerprint 0EBFCD88
- 添加稳定版repository
#sudo add-apt-repository \ # "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ # $(lsb_release -cs) \ # stable" #使用阿里云 sudo add-apt-repository \ "deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu \ $(lsb_release -cs) \ stable"
- 安装docker
sudo apt-get update sudo apt-get install docker-ce docker-ce-cli containerd.io
- 启动docker和设置开机自启
systemctl start docker systemctl enable docker
共有 0 条评论