目录
docker安装部署
1.环境
2.安装步骤
1.安装必要工具
2.配置软件源
3.修改软件源
4.更新并下载docker
5.设置开机自启
3.启动docker
1.配置docker镜像加速器
2.启动服务
docker安装部署
1.环境
centos7
2.安装步骤
1.安装必要工具
yum install -y yum-utils device-mapper-persistent-data lvm2
2.配置软件源
yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
3.修改软件源
sed -i 's+download.docker.com+mirrors.aliyun.com/docker-ce+' /etc/yum.repos.d/docker-ce.repo
4.更新并下载docker
yum makecache fast
yum -y install docker-ce
5.设置开机自启
systemctl enable docker.service
3.启动docker
1.配置docker镜像加速器
[root@localhost ~]# cat /etc/docker/daemon.json
{
"registry-mirrors": ["https://registry.docker-cn.com"]
}重载:
systemctl daemon-reload
重启docker
systemctl restart docker
查看信息
[root@localhost ~]# docker info
Registry Mirrors:
https://registry.docker-cn.com/ 最后有这个表示配置成功
2.启动服务
[root@localhost ~]# systemctl daemon-reload
[root@localhost ~]# systemctl enable docker
[root@localhost ~]# systemctl start docker
[root@localhost ~]# docker version
Client: Docker Engine - Community
Version: 24.0.5
API version: 1.43
Go version: go1.20.6
Git commit: ced0996
Built: Fri Jul 21 20:39:02 2023
OS/Arch: linux/amd64
Context: defaultServer: Docker Engine - Community
Engine:
Version: 24.0.5
API version: 1.43 (minimum version 1.12)
Go version: go1.20.6
Git commit: a61e2b4
Built: Fri Jul 21 20:38:05 2023
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.6.22
GitCommit: 8165feabfdfe38c65b599c4993d227328c231fca
runc:
Version: 1.1.8
GitCommit: v1.1.8-0-g82f18fe
docker-init:
Version: 0.19.0
GitCommit: de40ad0
其他环境可以参照阿里云网站的解答
docker-ce镜像_docker-ce下载地址_docker-ce安装教程-阿里巴巴开源镜像站 (aliyun.com)