安装Docker在Red Hat Linux 6.7上

3
我正在按照文档https://docs.docker.com/engine/installation/rhel/在RHEL 6.7上安装docker。当我运行以下命令时:
sudo yum install docker-engine

我得到了以下错误。
Error: Package: docker-engine-1.9.1-1.el7.centos.x86_64 (dockerrepo)
           Requires: libsystemd-journal.so.0(LIBSYSTEMD_JOURNAL_196)(64bit)
Error: Package: docker-engine-1.9.1-1.el7.centos.x86_64 (dockerrepo)
           Requires: libsystemd-journal.so.0(LIBSYSTEMD_JOURNAL_195)(64bit)
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

根据建议,我尝试运行了该命令。
sudo yum install docker-engine --skip-broken

这是输出。
    Packages skipped because of dependency problems:
    audit-libs-python-2.3.7-5.el6.x86_64 from RHEL-67-x86_64
    docker-engine-1.9.1-1.el7.centos.x86_64 from dockerrepo
    docker-engine-selinux-1.9.1-1.el7.centos.noarch from dockerrepo
    libsemanage-python-2.0.43-5.1.el6.x86_64 from RHEL-67-x86_64
    policycoreutils-python-2.0.83-24.el6.x86_64 from RHEL-67-x86_64
    setools-libs-3.3.7-4.el6.x86_64 from RHEL-67-x86_64
    setools-libs-python-3.3.7-4.el6.x86_64 from RHEL-67-x86_64

如何解决上述问题并在RHEL 6.7上安装Docker?
4个回答

6

RHEL 6已不再受Docker支持,你可以安装的最新版本是Docker 1.7。 安装说明可在此找到


谢谢回复。 - Anupam K
更糟糕的是,像selinux这样的东西似乎会严重干扰6.x RHEL和Docker 1.7...有一些必须输入的策略可能会解决问题,但很可能无法解决。我无法弄清楚它。(不幸的是,还有一些主机没有提供RHEL 7,如果你能相信的话)。 - Dexter
它适用于RedHat 6.9 Santiago。 容器:0 镜像:0 存储驱动程序:devicemapper 池名称:docker-253:0-130948-pool 池块大小:65.54 kB 支持的文件系统:extfs 已使用的数据空间:305.7 MB 数据空间总计:107.4 GB 可用数据空间:107.1 GB ... Udev同步支持:true 延迟删除已启用:false 库版本:1.02.117-RHEL6(2016-12-13) 执行驱动程序:native-0.2 日志记录驱动程序:json-file 内核版本:2.6.32-696.18.7.el6.x86_64 CPU:2 总内存:3.743 GiB - Gabriel Hernandez

3

以下步骤适用于在具有超级用户权限的用户上安装Docker到OEL 6.10。

  1. Create a user with SUDO Access as suggested in Red-Hat Docs ([Link][1] speaks well on this process). For instance I created an user as docker with group as docker.

    groupadd docker  
    useradd -m -g docker docker
    
  2. Add docker repository for installing latest copy of Docker for RHEL/Centos 6

    yum update -y  
    yum install epel-release  
    vi /etc/yum.repos.d/docker.repo   
    
  3. Add below contents to /etc/yum.repos.d/docker.repo

    [docker-repo]  
    name=Docker Repo  
    baseurl=https://yum.dockerproject.org/repo/main/centos/6/  
    enabled=1  
    gpgcheck=1  
    gpgkey=https://yum.dockerproject.org/gpg  
    
  4. Switch to "docker" user and execute below commands:

    sudo yum install -y docker-engine

  5. Post Installation start docker using below commands.

    sudo chkconfig docker on  
    
    sudo service docker start  
    Starting cgconfig service:                                 [  OK  ]  
    Starting docker:                                           [  OK  ]  
    
    sudo service docker status  
    docker (pid  26925) is running...  
    
    ps -ef | grep docker  
    root     25590 14123  0 Jul27 ?        00:00:00 sshd: docker [priv]  
    docker   25594 25590  0 Jul27 ?        00:00:00 sshd: docker@pts/1  
    docker   25595 25594  0 Jul27 pts/1    00:00:00 -bash  
    root     26925     1  2 00:00 pts/1    00:00:00 /usr/bin/docker -d  
    docker   27106 25595  0 00:00 pts/1    00:00:00 ps -ef  
    docker   27107 25595  0 00:00 pts/1    00:00:00 grep docker  
    
    docker ps -a  
    CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES  
    

    [1]: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux_OpenStack_Platform/2/html/Getting_Started_Guide/ch02s03.html


值得一提的是,Docker用户应该在sudoers中以便能够运行sudo命令。 - Marat

1
您可以通过将内核升级到3.10版本来安装最新版本的Docker。风险自负 :)
对我来说很有效,并且非常稳定,已经使用几周了。 升级RHEL内核

但这难道不需要systemd吗? - Vanuan

1

对我来说,这个链接很有用。我有一个Oracle服务器6.10,步骤如下:

  • 添加epel包:rpm -iUvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
  • 更新软件包:yum update -y
  • 安装Docker:yum install docker-io -y
  • 启动服务:/etc/init.d/docker start
  • 在启动机器上配置服务:chkconfig docker on

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接