【1】ubuntu 安装docker

官方支持安装docker的Ubuntu版本:

ubuntu trusty 14.04(LTS) (64位)

ubuntu precise 12.04(LTS) (64位)

ubuntu raring 16.04(64位)

ubuntu saucy 13.10(64位)

1、检查ubuntu版本号是否满足:

2、检查device mapper:   作为docker的存储驱动

或者在/proc/devices文件中检查是否有device-mapper条目:

3、检查是否安装了curl包:which curl  或者如果curl没有安装的话,更新apt源之后,安装curl包:$ sudo apt-get update $ sudo apt-get install curl

4、获取最新的docker安装包: curl -fsSL https://get.docker.com/ | sh

The system prompts you for your sudo password. Then, it downloads and installs Docker and its dependencies.

Note: If your company is behind a filtering proxy, you may find that the apt-key command fails for the Docker repo during installation. To work around this, add the key directly using the following:

  $ curl -fsSL https://get.docker.com/gpg | sudo apt-key add -

 

确认是否安装成功:

方法一:查看docker版本号:docker version,打印相应信息表示安装成功。

方法二:$ sudo docker run hello-world

这个命令会下载一个测试用的镜像并启动一个容器运行它。如下所示表示安装成功

其他安装方法:Docker有deb格式的安装包,安装起来非常的容易。

首先添加Docker库的密钥:sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9

然后把Docker的库添加到apt的源列表中,更新并安装lxc-docker包:

sudo sh -c "echo deb http://get.docker.io/ubuntu docker main
> /etc/apt/sources.list.d/docker.list"
sudo apt-get update
sudo apt-get install lxc-docker

5、查看是否安装成功:sudo docker info



原文地址:https://www.cnblogs.com/apple2016/p/6286210.html