Ubuntu环境下安装docker、docker-compose
1.卸载原版本docker
sudo apt-get remove docker docker-engine docker-ce docker.io2.更新apt
sudo apt-get update3.安装基本工具
sudo apt-get install curl wget apt-transport-https ca-certificates software-properties-common4.添加docker秘钥
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -5.验证
sudo apt-key fingerprint 0EBFCD886.添加镜像源
sudo add-apt-repository "deb [arch=arm64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"如镜像源缓慢 切换镜像源
sudo add-apt-repository "deb [arch=amd64] https://mirrors.nwafu.edu.cn/docker-ce/linux/ubuntu/ $(lsb_release -cs) stable"7.安装
sudo apt-get updatesudo apt-get install docker-ce8.查看docker状态
systemctl status docker9.添加阿里镜像
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://bhfjayzb.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
安装docker-compose
apt-get install -y docker-compose