原因
因为CentOS系统是32位的而不是64位的,官方支持比较少
安装过程错误信息如下:
root@VM_0_14_centos yum.repos.d]# sudo yum install docker
[root@VM_0_14_centos yum.repos.d]# service docker restart
docker: unrecognized service
[root@VM_0_14_centos yum.repos.d]# sudo yum install docker-io
Loaded plugins: fastestmirror, security
Setting up Install Process
Loading mirror speeds from cached hostfile
No package docker-io available.
Error: Nothing to do
[root@VM_0_14_centos ~]# docker run hello
Segmentation Fault or Critical Error encountered. Dumping core and aborting.
Aborted (core dumped)
正常安装步骤应该使用sudo yum install docker-io
命令
查看系统信息
如果输出 x86_64 则表示为 64 位系统,如果输出 i686 或 i386 则表示为 32 位系统。
[root@VM_0_14_centos yum.repos.d]# cat /etc/redhat-release
CentOS release 6.10 (Final)
[root@VM_0_14_centos yum.repos.d]# arch
i686
解决办法
- 搜索之后发现好像没有支持32位CentOS系统的 😱
32的ubuntu可以安装docker,但是pull下来的镜像必须是32位的,于是找到了这个:
https://registry.hub.docker.com/repos/32bit/
https://github.com/docker-32bit
- 最终我选择了重装CentOS7 64位系统然后执行
sudo yum install docker-io
和systemctl restart docker
命令成功安装docker输入docker version
来验证