阿里云系统 安装Docker&Docker-Compose
本文介绍在多种系统中的Docker安装方式
当然你也可以直接参考官方文档
1. 安装Docker任何架构任何系统版
#安装 curl -fsSL https://get.docker.com -o get-docker.sh sh get-docker.sh #启动 systemctl enable docker systemctl start docker #修改配置 sudo mkdir -p /etc/docker sudo tee /etc/docker/daemon.json <<-'EOF' { #此处指定docker的数据卷目录,请根据自己的磁盘挂载情况配置 "data-root": "/opt/docker", "registry-mirrors": [ "https://3laho3y3.mirror.aliyuncs.com", "https://hub-mirror.c.163.com", "http://f1361db2.m.daocloud.io", "http://hub-mirror.c.163.com" ] } EOF #重启 sudo systemctl daemon-reload systemctl restart docker #测试 docker run hello-world
Centos
#安装依赖 sudo yum install -y yum-utils device-mapper-persistent-data lvm2 #指定镜像源 sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo #安装docker,可替换需要的版本,默认为最新版本,仓库地址:https://download.docker.com/linux/centos/7/aarch64/stable/Packages/ sudo yum install -y docker-ce containerd.io docker-ce-cli #启动 systemctl enable docker systemctl start docker #修改配置 sudo mkdir -p /etc/docker sudo tee /etc/docker/daemon.json <<-'EOF' { "data-root": "/opt/docker", "registry-mirrors": [ "https://3laho3y3.mirror.aliyuncs.com", "https://hub-mirror.c.163.com", "http://f1361db2.m.daocloud.io", "http://hub-mirror.c.163.com" ] } EOF #重启 sudo systemctl daemon-reload systemctl restart docker #测试 docker run hello-world
from https://developer.aliyun.com/article/1165532