Love My Love

Docker-Install-Log

2016.02.17

参考:

For Windows 10(failed)

Reference:

Run Linux containers on Windows

Preparation

  1. hyper-v installed
  2. docker installed (2.2.0 install cannot be success. recommend 2.1.0)

Install(Method 1)

while, I update docker.exe everything goes well.

  1. Download docker.exe from Docker Master Binaries
  2. Replace C:\Program Files\Docker\Docker\resources\bin\docker.exe you download from link above, and you can download any image from container manager: Kitematic

Install(method 2 failed)

  1. Install docker desktop and download container manager: Kitematic

  2. download: Canonical Partner Images of Ubuntu for Linux containers on Microsoft Hyper-V and unzip it.

  3. mkdir C:\\lcow used as scratch space for Docker while preparing the containers.

  4. mkdir C:\\Program Files\\Linux Containers where the Ubuntu container image will live.

  5. TIPS: never change the path: C:\\Program Files\\Linux Containers, it must be there.

  6. Save script below to .\set_perms.ps1:

    1. param(
      [string] $Root
      )
      # Give the virtual machines group full control
      $acl = Get-Acl -Path $Root
      $vmGroupRule = new-object System.Security.AccessControl.FileSystemAccessRule("NT VIRTUAL MACHINE\Virtual Machines", "FullControl","ContainerInherit,ObjectInherit", "None", "Allow")
      $acl.SetAccessRule($vmGroupRule)
      Set-Acl -AclObject $acl -Path $Root
      
    2. You will need to give this folder extra permissions to allow Docker to use the images from it. Run the following Powershell script in an administrator Powershell window:

    3. TIP You may need to run Set-ExecutionPolicy -Scope process unrestricted to be allowed to run unsigned Powershell scripts.

    4. .\set_perms.ps1 "C:\\Program Files\\Linux Containers"
      
  7. Now, copy the Ubuntu container image .vhdx file that was decompressed at the previous step to uvm.vhdx under C:\Program Files\Linux Containers.

For Ubuntu

系统要求

use command blow:

uname -a

or

cat /proc/version

to get the kenrel version that is must biger than 3.10.

Notice: Your Ubuntu version must biger than 12.04.

First to update or have these packages which is blow:

  • linux-image-generic-lts-trusty (必备)
  • linux-headers-generic-lts-trusty (必备)
  • xserver-xorg-lts-trusty (带图形界面时必备)
  • libgl1-mesa-glx-lts-trusty(带图形界面时必备)

To use aufs storage,you’d better get the package:linux-image-extra

sudo apt-get install -y linux-image-extra-$(uname -r)

添加镜像源

首先需要安装 apt-transport-https 包支持 https 协议的源。

sudo apt-get install -y apt-transport-https

添加源的 gpg 密钥。

sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D

获取当前操作系统的代号。

lsb_release -c
// echo info!
Codename:   wily

12.04 (LTS) 代号为 precise,14.04 (LTS) 代号为 trusty,15.04 代号为 vivid,15.10 代号为 wily。

接下来就可以添加 Docker 的官方 apt 软件源了。通过下面命令创建 /etc/apt/sources.list.d/docker.list 文件,并写入源的地址内容。wily 版本的系统注意修改为自己对应的代号。

sudo cat <<EOF > /etc/apt/sources.list.d/docker.list
deb https://apt.dockerproject.org/repo ubuntu-wily main
EOF

如果执行报权限不足,请直接 suroot 用户执行。

添加成功后,更新 apt 软件包缓存。

sudo apt-get update
发表评论