在RedHatLinux 6.7上安装docker [英] Install docker on RedHatLinux 6.7
问题描述
我正在遵循文档 https://docs.docker.com/engine/installation/ rhel / 在RHEL 6.7上安装docker。
运行命令
I am following the documentation https://docs.docker.com/engine/installation/rhel/ to install docker on RHEL 6.7. When I run the command
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
根据我尝试运行命令的建议
As per the suggestion I tried to run the command
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?
How can I fix above problems and install docker on RHEL 6.7 ?
推荐答案
以下步骤确实可以将Docker安装在OEL上6.10具有超级用户权限的用户。
Below steps do work for Docker to be installed on OEL 6.10 with a user having super user privileges.
-
根据Red-Hat Docs中的建议创建具有SUDO Access的用户([ ] [1]在此过程中讲得很好。例如,我创建了一个用户作为docker,组为docker。
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
添加Docker存储库以为RHEL / Centos 6安装最新的Docker副本
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
将以下内容添加到/etc/yum.repos.d/docker.repo
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
切换到 docker用户并执行以下命令:
Switch to "docker" user and execute below commands:
sudo yum install -y docker-engine
安装后使用以下命令启动docker。
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
这篇关于在RedHatLinux 6.7上安装docker的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!