码迷,mamicode.com
首页 > 系统相关 > 详细

Linux下安装docker

时间:2018-07-12 01:03:58      阅读:266      评论:0      收藏:0      [点我收藏+]

标签:art   get   read   下载   ima   安装docker   latest   height   homebrew   


前言

      因为之前在自己的mac上直接使用HomeBrew的包管理安装的,使用brew install docker即可,这种方法简单,但最近想尝试在Linux下安装,费了一些时间,主要是启动docker时报异常 Failed to start docker.service: Unit not found.下面是自己安装的步骤。

     安装前准备:

  •      先查看linux内核信息及操作系统信息

  1.       linux版本及内核信息可用 uname -a ,从下图可知,内核为64位版本为3.10.0 

  2.       cat /proc/version //查看当前操作系统版本信息

  3.       cat /etc/redhat-release  //查看版本当前操作系统发行版信息

  4.      从图中可知linux内核为3.10.0 操作系统发行版本为Red Hat 7.2

  • 官网上写的从Read Hat 7开始才支持安装
    Docker is supported on Red Hat Enterprise Linux 7.
    Docker requires a 64-bit OS and version 3.10 or higher of the Linux kernel.

    官网地址https://docs.docker.com/install/linux/docker-ee/rhel/#prerequisites
    • 所以环境准备完全满足
  • 技术分享图片

     安装:

  1.    下载安装libcgroup的rpm包(该软件包提供了一系列工具和库文件用于控制和管理控制组)
  2.      libcgroup软件包下载地址:ftp://mirror.switch.ch/pool/4/mirror/scientificlinux/6.5/x86_64/updates/fastbugs/libcgroup-0.40.rc1-6.el6_5.1.x86_64.rpm
  3.    下载libcgroup的rpm包: wget ftp://mirror.switch.ch/pool/4/mirror/scientificlinux/6.5/x86_64/updates/fastbugs/libcgroup-0.40.rc1-6.el6_5.1.x86_64.rpm
  4.    安装libcgroup的rpm包: rpm -ivh libcgroup-0.40.rc1-6.el6_5.1.x86_64.rpm
  5.    更新yum源(当前yum源里可能没有docker):先下载epel的rpm包:        wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
  6.    安装epel的rpm包:rpm -ivh epel-release-latest-6.noarch.rpm
  7.    安装docker: yum install docker-io

技术分享图片

 

  •  安装完后启动docker的服务:service docker start 后报unit not found,如下图所示

技术分享图片

 

  • 经过查询说是在目录/usr/lib/systemd/system下少一个docker.socket的文件,但是安装的docker是1.13.1的版本不需要此文件的; 
  • 无奈之下,之后重新安装,仍然使用yum install docker-io 命令;
  • 此时奇迹出现了,再次使用service docker start时,启动成功了;

技术分享图片

 

 


     

     

 

Linux下安装docker

标签:art   get   read   下载   ima   安装docker   latest   height   homebrew   

原文地址:https://www.cnblogs.com/guanbin-529/p/9297447.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!