wget -O /etc/yum.repos.d/openEulerOS.repo https://repo.huaweicloud.com/repository/conf/openeuler_aarch64.repo
yum update
yum clean all
yum makecache
yum install -y docker
sudo systemctl start docker
systemctl enable docker.service
systemctl list-unit-files |grep docker
显示:docker.service enabled,则设置自启成功。
docker info |grep "Docker Root Dir"
Docker Root Dir: /var/lib/docker
默认位置:/var/lib/docker,后续镜像和容器的相关文件都会存储在这。
如果挂盘,不想放默认位置,则创建docker存储目录,如:需求是放/data/docker,则创建目录
mkdir -p /data/docker
然后设置全局Docker容器日志大小,并修改docker的存储目录,在/etc/docker目录创建daemon.json文件,然后写入以下内容,最后重启docker和系统加载文件
vi /etc/docker/daemon.json
{
"registry-mirrors": ["https://pee6w651.mirror.aliyuncs.com"],
"log-driver":"json-file",
"log-opts": {"max-size":"100m", "max-file":"1"},
"data-root": "/data/docker"
}
systemctl daemon-reload
systemctl restart docker
执行docker info
会显示目录已更改为/data/docker。
sudo curl -L https://get.daocloud.io/docker/compose/releases/download/1.27.4/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose -version
sudo rm /usr/local/bin/docker-compose
step1: 安装必要的一些系统工具
sudo apt-get update
sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common
step2、安装GPG证书
curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
step3: 写入软件源信息
sudo add-apt-repository "deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get -y update
sudo apt-get -y install docker-ce
service docker status
systemctl enable docker
[root@clean ~] systemctl list-unit-files |grep docker
docker.service enabled
显示:docker.service enabled,则设置自启成功。
docker info |grep "Docker Root Dir"
Docker Root Dir: /var/lib/docker
默认位置:/var/lib/docker,后续镜像和容器的相关文件都会存储在这。
如果挂盘,不想放默认位置,则创建docker存储目录,如:需求是放/data/docker,则创建目录
mkdir -p /data/docker
然后设置全局Docker容器日志大小,并修改docker的存储目录,在/etc/docker目录创建daemon.json文件,然后写入以下内容,最后重启docker和系统加载文件
vi /etc/docker/daemon.json
{
"registry-mirrors": ["https://pee6w651.mirror.aliyuncs.com"],
"log-driver":"json-file",
"log-opts": {"max-size":"100m", "max-file":"1"},
"data-root": "/data/docker"
}
systemctl daemon-reload
systemctl restart docker
执行docker info
会显示目录已更改为/data/docker。
sudo curl -L https://get.daocloud.io/docker/compose/releases/download/1.27.4/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose -version
sudo rm /usr/local/bin/docker-compose