centos安装docker

先导入key

直接官网安装报错:docker-ce-26.1.3-1.el7.x86_64.rpm 的公钥尚未安装

公钥地址

https://mirrors.163.com/centos/

rpm --import http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

安装docker

//
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
//
sudo yum makecache fast
//
sudo yum install docker-ce docker-ce-cli containerd.io
//
sudo systemctl start docker  
sudo systemctl enable docker
//
vim /etc/docker/daemon.json
//
{"registry-mirrors":["http://hub-mirror.c.163.com","http://hub-mirror.c.163.com","https://registry.docker-cn.com","https://docker.mirrors.ustc.edu.cn","https://cr.console.aliyun.com/"]}
//
sudo systemctl daemon-reload
sudo systemctl restart docker

 

posted @ 2024-06-04 02:01  白玉神驹  阅读(99)  评论(0编辑  收藏  举报