三木社区

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 360|回复: 0
打印 上一主题 下一主题

红帽RHEL安装docker容器引擎

[复制链接]

1657

主题

1684

帖子

5684

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
5684
跳转到指定楼层
楼主
发表于 2017-7-14 08:01:12 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
目前红帽RHEL系统下面安装docker可以有两种方式:一种是使用curl获得docker的安装脚本进行安装,还有一种是使用yum包管理器来安装docker。
一、使用安装脚本安装。

备注:你可以按照同样的步骤在CentOS系统下面安装docker。

使用一个有sudo权限的帐号登录红帽系统。
更新现有的yum包。

  1. $ sudo yum update
复制代码

执行docker安装脚本。
$ curl -sSL https://get.docker.com/ | sh


启动docker服务。
  1. $ sudo service docker start
复制代码
确认docker安装成功。
  1. $ sudo docker run hello-world
  2. Unable to find image 'hello-world:latest' locally
  3. latest: Pulling from hello-world
  4. a8219747be10: Pull complete 91c95931e552: Already exists
  5. hello-world:latest: The image you are pulling has been verified. Important: image verification is a tech preview feature and should not be relied on to provide security. Digest: sha256:aa03e5d0d5553b4c3473e89c8619cf79df368babd1.7.1cf5daeb82aab55838d
  6. Status: Downloaded newer image for hello-world:latest
  7. Hello from Docker.
  8. This message shows that your installation appears to be working correctly.
  9. To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
  10.         (Assuming it was not already locally available.) 3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading. 4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal.

  11. To try something more ambitious, you can run an Ubuntu container with:
  12. $ docker run -it ubuntu bash
  13. For more examples and ideas, visit: http://docs.docker.com/userguide/
复制代码

使用yum包安装
使用有sudo权限的帐号登录系统。
更新yum包。

  1. $ sudo yum update
复制代码
添加docker源。
  1. $ cat >/etc/yum.repos.d/docker.repo <<-EOF
  2. [dockerrepo]
  3. name=Docker Repository
  4. baseurl=https://yum.dockerproject.org/repo/main/centos/7 enabled=1 gpgcheck=1 gpgkey=https://yum.dockerproject.org/gpg EOF
复制代码
使用yum命令安装docker。
  1. $ sudo yum install docker-engine
复制代码
启动docker服务。
  1. $ sudo service docker start
复制代码
确认docker是否安装成功。
  1. $ sudo docker run hello-world
复制代码


回复

使用道具 举报

Archiver|手机版|小黑屋|三木电子社区 ( 辽ICP备11000133号-4 )

辽公网安备 21021702000620号

GMT+8, 2025-10-19 00:47 , Processed in 0.030176 second(s), 22 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表