Docker入门学习二之安装Docker

1、Windows安装linux

      1.下载地址:docker

      boot2docker.iso下载地址:http://pan.baidu.com/s/1qYyc0agjson

      2.安装步骤(演示Windows10):windows

      前提:Windows10,开启Hyper-Vcentos

      (1)首先确认本身开启Hyper-V,经过任务管理器,选择性能能够查看虚拟化是否启用,如图:bash

     

      若是没有启用,则到控制面板--->程序--->启用或关闭Windowsg功能--->勾选Hyper-V,如图:性能

     

      若是Hyper-V虚拟监控程序没法勾选,并提示没法安装Hyper-V 该固件中的虚拟化支持被禁用,则说明你的BIOS设置中没有启用虚拟化支持,那么重启电脑--->进入BIOS--->找到Advanced--->选择CPU Setup--->有一个Intel(R) Virtualization Technology之类的--->将其状态修改为Enabled,即启用虚拟化服务。这时你就能够勾选Hyper-V虚拟监控程序了。以下图:ui

     

    

      若是当你勾选整个Hyper-V,点击确认后,弹出错误代码:0x80070057,那可能你当前的Windows10版本不支持Hyper-V( Win10虚拟机hyper-V是Win10预览版,专业版,企业版才有的功能,其余的Win10版本都是没有的,联想电脑预装的Win10系统都是不带hyper-V功能的,请提早核实好您的Win10版本类型 ),若是核实以后,确认你当前版本是符合要求的,那多是你Windows10版本的小版本号不符合(你运行cmd,进入就能够看到你当前系统的小版本号,好比,个人是Microsoft Windows [版本 10.0.14393]),你能够尝试前往这里https://www.microsoft.com/zh-cn/software-download/windows10更新到最新的Windows10系统!到此,你应该能够成功安装了,祝你好运吧!url

      (2)双击下载的安装文件,开始安装,若是你安装了360之类的电脑管家,可能须要先关闭或者容许Docker安装的操做,而后就会出现看到下图:spa

     

      (3)启动Docker成功,会出现以下图:

      若是你尚未Docker帐号,能够去注册一个Docker ID

     

      若是启动的时候,提示内存不足,启动失败,能够在setting设定中调节VM内存大小 ,如图:

     

      (4)以管理员身份运行cmd,查看Docker版本信息,以下:

C:\WINDOWS\system32>docker info
Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 0
Server Version: 17.09.0-ce
Storage Driver: overlay2
 Backing Filesystem: extfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host ipvlan macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 06b9cb35161009dcb7123345749fef02f7cea8e0
runc version: 3f2f8b84a77f73d38244dd690525642a72156c64
init version: 949e6fa
Security Options:
 seccomp
  Profile: default
Kernel Version: 4.9.49-moby
Operating System: Alpine Linux v3.5
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 1.934GiB
Name: moby
ID: FVZI:6LBP:XJM6:X3ST:VW5H:SP42:OL6D:VMIG:TRVR:C5VP:KL53:RZ44
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
 File Descriptors: 16
 Goroutines: 25
 System Time: 2017-11-03T03:49:39.0493103Z
 EventsListeners: 0
Registry: https://index.docker.io/v1/
Experimental: true
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

     

2、MacOS安装(最简单)    

      1.下载地址:

      在Yosemite10.10.3以前须要借助docker-toolbox在Mac上虚拟一个Linux系统,在Yosemite10.10.3以后已经原生支持Mac了!

3、Linux安装(最推荐)

      1.系统版本以及安装要求:

  • Redhat & CentOS:系统要求:64 bit OS and  kernel version 3.10
  • Ubuntu:系统要求:64 bit OS and kernel version 3.10

      2.在Redhat和CentOS上安装步骤

      (1)检查内核版本,返回值大于3.10便可

$ uname -r

      (2)使用sudo或root权限的用户登陆终端

      (3)确保yum是最新的

$ yum update

      (4)添加yum仓库

$ tee /etc/yum.repos.d/docker.repo <<-'EOF' 
[dockerrepo] 
name=Docker Repository 
baseurl=https://yum.dockerproject.org/repo/main/centos/$releasever/ 
enabled=1 
gpgcheck=1 
gpgkey=https://yum.dockerproject.org/gpg 
EOF

      (5)安装Docker

$ yum install -y docker-engine

      (6)启动Docker

$ systemctl start docker.service

      (7)验证安装是否成功(有client和service两部分表示docker安装启动都成功了)

M:~$docker version 
Client: 
 Version: 1.13.1 
 API version: 1.26 
 Go version: go1.7.5 
 Git commit: 092cba3 
 Built: Wed Feb 8 08:47:51 2017 
 OS/Arch: darwin/amd64 
Server: 
 Version: 1.13.1 
 API version: 1.26 (minimum version 1.12) 
 Go version: go1.7.5 
 Git commit: 092cba3 
 Built: Wed Feb 8 08:47:51 2017 
 OS/Arch: linux/amd64 
 Experimental: true

 

本文为原创文章,若是对你有一点点的帮助,别忘了点赞哦!比心!如需转载,请注明出处,谢谢!

相关文章
相关标签/搜索