install docker on Ubuntu 14.04

The main reference I referred is the official guide of docker link.

$ sudo apt-get update
$ sudo apt-get install  linux-image-extra-$(uname -r) 
$ sudo apt-get install  linux-image-extra-virtual
1. Install packages to allow apt to use a repository over HTTPS:
$ sudo apt-get install  apt-transport-https \
  ca-certificates \
  curl \
  software-properties-common
2. Add Docker’s official GPG key:
 $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

 $ sudo apt-key fingerprint 0EBFCD88
3. Set up (add) the stable repository to the apt package list.

amd64:

    $ sudo add-apt-repository \
      "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
      $(lsb_release -cs) \
      stable"

armhf:

$ sudo add-apt-repository \
   "deb [arch=armhf] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"
4. Update the apt package index.
$ sudo apt-get update
5. Install Docker.
$ sudo apt-get install docker-ce

Notes:

  • You can also install it with specific version:

    $ sudo apt-get install docker-ce=<VERSION>

  • Update docker you have installed:

    $ sudo apt-get upgrade docker-ce=<VERSION>

    Example:

    //List the available versions.
    jeremy@compute1:~$ apt-cache madison docker-ce
     docker-ce | 17.03.1~ce-0~ubuntu-trusty | https://download.docker.com/linux/ubuntu/ trusty/stable amd64 Packages
     docker-ce | 17.03.0~ce-0~ubuntu-trusty | https://download.docker.com/linux/ubuntu/ trusty/stable amd64 Packages
     //upgrade a specific version of docker
    jeremy@compute1:~$ sudo apt-get upgrade docker-ce=17.03.1~ce-0~ubuntu-trusty
    ...
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    Calculating upgrade... Done
    docker-ce is already the newest version.
    ...
    
  • If you encounter a error like “E: Unable to locate package docker-ce”, please run $sudo apt-get update

6. Test the installation.
jeremy@compute1:~$ sudo docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
78445dd45222: Pull complete 
Digest: sha256:c5515758d4c5e1e838e9cd307f6c6a0d620b5e07e6f927b07d05f6d12a1ac8d7
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.
7. Enjoy yourself.




If you encounter an error said “dpkg-statoverride: error: an override for ‘/boot/vmlinuz-3.13.0-119-generic’ already exists; aborting” when you run sudo apt-get install xxx, please go here.






Reference:

https://docs.docker.com/engine/installation/linux/ubuntu/#install-using-the-repository

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值