zoukankan      html  css  js  c++  java
  • 安装docker

    • 1.windows PC安装docker(个人不建议使用windows)

    Docker for Windows 支持 64 位版本的 Windows 10 Pro,且必须开启 Hyper-V。

    简单说就是想安装在windows上 电脑需要是win64 专业版 并且必须开启虚拟化(哎,很多人看到这就不想安装了,别呀,人家又没有说必须是专业版,只是虚拟化必须要有)

    先说windows专业版:

            (1).安装

        点击以下链接下载 Stable 或 Edge 版本的 Docker for Windows。

        下载好之后双击 Docker for Windows Installer.exe 开始安装。

      (2).运行  

        在 Windows 搜索栏输入 Docker 点击 Docker for Windows 开始运行。

        

        Docker CE 启动之后会在 Windows 任务栏出现鲸鱼图标。

        

        等待片刻,点击 Got it 开始使用 Docker CE。

       

      (3).镜像加速

        鉴于国内网络问题,后续拉取 Docker 镜像十分缓慢,强烈建议安装 Docker 之后配置 国内镜像加速。

    然后说一下windows家庭版:

      (1).安装

        由于Windows10家庭版中没有Hyper-V的安装,所以在家庭版中安装Docker必须使用Docker Toolbox来安装。

        Docker Toolbox下载地址:https://www.docker.com/products/docker-toolbox,选择Windows版本,点击下载即可。

        下载完成后,双击DockerToolbox.exe进行安装,一路next就可以,完成后会有下图三个图标,如图:

     
        
          Docker
      (2).运行
        双击Docker Quickstart Terminal
        可能会报错
        
                        错误信息
        我记得这个错好像是说这个电脑上以前安装过git所以找不到默认的git base.exe文件了,你只需要去帮他找到git的base.exe文件就好了
        
        在这修改git的base.exe文件目录
        windows安装docker完事了
     
     

    2.centos安装docker(个人不建议使用windows)

    (1).查询本机器的内核

    1 [root@bogon ~]# uname -r
    2 2.6.32-358.el6.x86_64

    (2). 内核太低,需要升级内核

    在yum的ELRepo源中,有 m ain l ine(3.13.1)、 l ong- t erm(3.10.28)这2个内核版本,考虑到long-term更稳定,会长期更新,所以选择这个版本。

    • 导入public key :
      1 rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
    • 安装ELRepo到CentOS-6.5中:
      1 rpm -ivh http://www.elrepo.org/elrepo-release-6-5.el6.elrepo.noarch.rpm
    • 安装 kernel-lt(lt=long-term):
      1 yum --enablerepo=elrepo-kernel install kernel-lt -y

      或者安装kernel-ml(ml=mainline):
      1 yum --enablerepo=elrepo-kernel install kernel-ml -y
    • 因为之前我配置阿里的yum源,所以在安装kernel-lt时一直报错:Error: Cannot retrieve repository metadata (repomd.xml) for repository: epel. Please verify its path and try again,元数据地址发生改变,不能获取数据。所以将epel.repo中的enabled=1改为enabled=0
    • 编辑grub.conf文件,修改Grub引导顺序,确认刚安装好的内核在哪个位置,然后设置default值(从0开始),一般新安装的内核在第一个位置,所以设置default=0。
      1 vi /etc/grub.conf
      #boot=/dev/sda
      default=0
      timeout=5
      splashimage=(hd0,0)/grub/splash.xpm.gz
      hiddenmenu
      title CentOS (4.10.3-1.el6.elrepo.x86_64)
              root (hd0,0)
              kernel /vmlinuz-4.10.3-1.el6.elrepo.x86_64 ro root=UUID=6f659055-ea8a-4ac1-9421-e91eb44ea7e0 rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto  KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet
              initrd /initramfs-4.10.3-1.el6.elrepo.x86_64.img
      title CentOS (2.6.32-358.el6.x86_64)
              root (hd0,0)
              kernel /vmlinuz-2.6.32-358.el6.x86_64 ro root=UUID=6f659055-ea8a-4ac1-9421-e91eb44ea7e0 rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto  KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet
      
    • 重启
      init 6
    • 重新查看内核
      [root@bogon ~]# uname -r
      4.10.3-1.el6.elrepo.x86_64

    (3).安装docker

    • 更新yum源
    1 yum install
    • 生成docker.repo 
    yum -y install http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm安装
    • 安装docker
    1 yum install -y docker-io
    • 启动docker
    1 docker -d
    • 设置开机自启
    1 chkconfig docker on
    • 重启即可
  • 相关阅读:
    __setattr__,__getattr__,__delattr__
    LeetCode 面试题42. 连续子数组的最大和
    LeetCode 53. 最大子序和
    LeetCode 面试题39. 数组中出现次数超过一半的数字
    LeetCode 169. 多数元素
    LeetCode 426.将二叉搜索树转化为排序的双向链表
    LeetCode 面试题36. 二叉搜索树与双向链表
    LeetCode 面试题35. 复杂链表的复制
    LeetCode 138. 复制带随机指针的链表
    LeetCode 面试题34. 二叉树中和为某一值的路径
  • 原文地址:https://www.cnblogs.com/ltn26/p/10138831.html
Copyright © 2011-2022 走看看