因为最近在给服务器更换镜像,好多软件需要重新安装,此处记录备份一下
# 假如本地有旧版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