美文网首页
Ubuntu安装Docker

Ubuntu安装Docker

作者: DH大黄 | 来源:发表于2022-01-15 14:38 被阅读0次

因为最近在给服务器更换镜像,好多软件需要重新安装,此处记录备份一下

# 假如本地有旧版docker,先卸载
sudo apt-get remove docker docker-engine docker.io containerd runc
# 更新
sudo apt-get update
# 允许使用HTTPS传输
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
# 添加国内镜像源 稳定版docker
curl -fsSL https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
# 添加docker软件源头
sudo add-apt-repository \
 "deb [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu \
    $(lsb_release -cs) \
    stable"
# 安装docker
sudo apt-get install -y docker-ce docker-ce-cli containerd.io
# 下载docker-compose 并上传到 /usr/local/bin
# 授予权限
sudo chmod +x /usr/local/bin/docker-compose

docker-compose 下载地址:
https://github.com/docker/compose/releases/tag/v2.2.3

相关文章

网友评论

      本文标题:Ubuntu安装Docker

      本文链接:https://www.haomeiwen.com/subject/shbthrtx.html