docker 1.8+之后ubuntu安装指定版本docker-engine

这边记录ubuntu安装过程,首先是官网文档

  1. If you haven’t already done so, log into your Ubuntu instance.

  2. Open a terminal window.

  3. Add the new gpg key.

    $ apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
    
  4. Open the /etc/apt/sources.list.d/docker.list file in your favorite editor.

    If the file doesn’t exist, create it.

  5. Remove any existing entries.

  6. Add an entry for your Ubuntu operating system.

    The possible entries are:

    # Ubuntu Precise
    deb https://apt.dockerproject.org/repo ubuntu-precise main
    # Ubuntu Trusty
    deb https://apt.dockerproject.org/repo ubuntu-trusty main
    # Ubuntu Vivid
    deb https://apt.dockerproject.org/repo ubuntu-vivid main
    # Ubuntu Wily
    deb https://apt.dockerproject.org/repo ubuntu-wily main
    
  7. Save and close the /etc/apt/sources.list.d/docker.list file.

  8. Update the apt package index.

    $ apt-get update
    
  9. Purge the old repo if it exists.

    $ apt-get purge lxc-docker*
    
  10. Verify that apt is pulling from the right repository.

    $ apt-cache policy docker-engine

 

~# apt-cache policy docker-engine
docker-engine:
  Installed: 1.8.3-0~precise
  Candidate: 1.8.3-0~wily
  Version table:
     1.8.3-0~wily 0
        500 https://apt.dockerproject.org/repo/ ubuntu-wily/main amd64 Packages
     1.8.3-0~vivid 0
        500 https://apt.dockerproject.org/repo/ ubuntu-vivid/main amd64 Packages
     1.8.3-0~trusty 0
        500 https://apt.dockerproject.org/repo/ ubuntu-trusty/main amd64 Packages
 *** 1.8.3-0~precise 0
        500 https://apt.dockerproject.org/repo/ ubuntu-precise/main amd64 Packages
        100 /var/lib/dpkg/status
     1.8.2-0~wily 0
        500 https://apt.dockerproject.org/repo/ ubuntu-wily/main amd64 Packages
     1.8.2-0~vivid 0
        500 https://apt.dockerproject.org/repo/ ubuntu-vivid/main amd64 Packages
     1.8.2-0~trusty 0
        500 https://apt.dockerproject.org/repo/ ubuntu-trusty/main amd64 Packages
     1.8.2-0~precise 0
        500 https://apt.dockerproject.org/repo/ ubuntu-precise/main amd64 Packages
     1.8.1-0~wily 0
        500 https://apt.dockerproject.org/repo/ ubuntu-wily/main amd64 Packages
     1.8.1-0~vivid 0
        500 https://apt.dockerproject.org/repo/ ubuntu-vivid/main amd64 Packages
     1.8.1-0~trusty 0
        500 https://apt.dockerproject.org/repo/ ubuntu-trusty/main amd64 Packages
     1.8.1-0~precise 0
        500 https://apt.dockerproject.org/repo/ ubuntu-precise/main amd64 Packages
     1.8.0-0~wily 0
        500 https://apt.dockerproject.org/repo/ ubuntu-wily/main amd64 Packages
     1.8.0-0~vivid 0
        500 https://apt.dockerproject.org/repo/ ubuntu-vivid/main amd64 Packages
     1.8.0-0~trusty 0
        500 https://apt.dockerproject.org/repo/ ubuntu-trusty/main amd64 Packages
     1.8.0-0~precise 0
        500 https://apt.dockerproject.org/repo/ ubuntu-precise/main amd64 Packages
     1.7.1-0~wily 0
        500 https://apt.dockerproject.org/repo/ ubuntu-wily/main amd64 Packages
     1.7.1-0~vivid 0
        500 https://apt.dockerproject.org/repo/ ubuntu-vivid/main amd64 Packages
     1.7.1-0~trusty 0
        500 https://apt.dockerproject.org/repo/ ubuntu-trusty/main amd64 Packages
     1.7.1-0~precise 0
        500 https://apt.dockerproject.org/repo/ ubuntu-precise/main amd64 Packages
     1.7.0-0~vivid 0
        500 https://apt.dockerproject.org/repo/ ubuntu-vivid/main amd64 Packages
     1.7.0-0~trusty 0
        500 https://apt.dockerproject.org/repo/ ubuntu-trusty/main amd64 Packages

 

最后选定特定发行版的一个docker-engine版本进行安装即可

apt-get install -y docker-engine=1.8.1-0~precise

 

 

posted @ 2015-10-13 16:09  yanghuahui  阅读(7727)  评论(0编辑  收藏  举报