安装docker
安装docker
1.安装gcc gcc-c++
yum -y install gcc gcc-c++
验证gcc是否安装成功
2.安装需要的软件包
yum install -y yum-utils device-mapper-persistent-data lvm2
3.设置stable镜像仓库
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
4.更新yum软件包索引
yum makecache fast
5.安装DOCKER CE
yum -y install docker-ce
6.启动docker
systemctl start docker
systemctl enable docker
7.测试
docker version
8.配置镜像加速
mkdir -p /etc/docker
vim /etc/docker/daemon.json
在文件中添加如下配置
{"registry-mirrors": ["http://hub-mirror.c.163.com"] }
[root@pro_105 /]# cat /etc/docker/daemon.json
{
"registry-mirrors": [
"http://hub-mirror.c.163.com",
"https://docker.mirrors.ustc.edu.cn",
"https://registry.docker-cn.com"
]
}
[root@pro_105 /]#
systemctl daemon-reload
systemctl restart docker
12、停止、卸载、删除
systemctl stop docker
yum -y remove docker-ce
rm -rf /var/lib/docker
参考
https://blog.csdn.net/qq_40180411/article/details/103762341?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522164480055716781685327422%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fall.%2522%257D&request_id=164480055716781685327422&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2allfirst_rank_ecpm_v1~rank_v31_ecpm-6-103762341.pc_search_insert_es_download&utm_term=vmware++centos7%E4%B8%8A%E5%AE%89%E8%A3%85docker&spm=1018.2226.3001.4187