天天看点

Centos 6.10 安装docker

技术文档请注意发布时间,尽量查看1年以内的。

测试未通过,失败!过程仅供参考

环境:

         [[email protected] ~]# uname -r

         2.6.32-754.35.1.el6.x86_64

现象:

阿里云Centos 6.10 更新清华源后无法安装docker。查看网上大佬的解释说Docker 在 CentOS-6.5 或更高的版本的 CentOS 上时,要求系统为64位、系统内核版本为 2.6.32-431 或者更高版本。阿里云的这个版本更低 6.10。。。

解决:

0x01--先更新阿里源

Centos6.10 YumRepo Error: All mirror URLs are not using ftp, http[s] or file.报错解决方法--20220609已_⎛⎝世界⎠⎞的博客-CSDN博客
https://blog.csdn.net/sedbz/article/details/125207705?spm=1001.2014.3001.5501
           

0x02-- 安装

[[email protected] ~]# yum install -y epel-release
Setting up Install Process
Package epel-release-6-8.noarch already installed and latest version
Nothing to do

// RPM
[[email protected] ~]# rpm -Uvh https://mirrors.tuna.tsinghua.edu.cn/elrepo/elrepo/el6/x86_64/RPMS/elrepo-release-6-12.el6.elrepo.noarch.rpm

// 安装docker源
[[email protected] ~]# yum install https://get.docker.com/rpm/1.7.1/centos-6/RPMS/x86_64/docker-engine-1.7.1-1.el6.x86_64.rpm
Setting up Install Process
docker-engine-1.7.1-1.el6.x86_64.rpm                                                                         | 4.5 MB     00:01     
Examining /var/tmp/yum-root-1Rjozo/docker-engine-1.7.1-1.el6.x86_64.rpm: docker-engine-1.7.1-1.el6.x86_64
Marking /var/tmp/yum-root-1Rjozo/docker-engine-1.7.1-1.el6.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package docker-engine.x86_64 0:1.7.1-1.el6 will be installed
--> Processing Dependency: libcgroup for package: docker-engine-1.7.1-1.el6.x86_64
--> Running transaction check
---> Package libcgroup.x86_64 0:0.40.rc1-27.el6_10 will be installed
--> Finished Dependency Resolution

=====================================================================================

Total size: 19 M
Total download size: 131 k
Installed size: 20 M
Is this ok [y/N]: y

Running Transaction
Warning: RPMDB altered outside of yum.
  Installing : libcgroup-0.40.rc1-27.el6_10.x86_64                                                                              1/2 
  Installing : docker-engine-1.7.1-1.el6.x86_64                                                                                 2/2 
  Verifying  : docker-engine-1.7.1-1.el6.x86_64                                                                                 1/2 
  Verifying  : libcgroup-0.40.rc1-27.el6_10.x86_64                                                                              2/2 

Installed:
  docker-engine.x86_64 0:1.7.1-1.el6                                                                                                

Dependency Installed:
  libcgroup.x86_64 0:0.40.rc1-27.el6_10                                                                                             

Complete!
[[email protected] ~]# 
           

0x03-- 验证

[[email protected] ~]# docker
Usage: docker [OPTIONS] COMMAND [arg...]

A self-sufficient runtime for linux containers.

Options:

  --api-cors-header=                   Set CORS headers in the remote API
  -b, --bridge=                        Attach containers to a network bridge
  --bip=                               Specify network bridge IP
  -D, --debug=false                    Enable debug mode
  -d, --daemon=false                   Enable daemon mode


//  如果报错。则:
[[email protected] ~]# yum install -y docker-io
或者
[[email protected] ~]# curl -sSL https://get.docker.com | sh
           

 引用:

        centos6下安装docker - 李东平|一线码农 - 博客园

https://www.cnblogs.com/newAndHui/p/13508784.html

        CentOS6.8上Docker的安装 - 知乎

https://zhuanlan.zhihu.com/p/86005932

继续阅读