docker的安装,配置,更新和卸载
Docker支持下面的这些Ubuntu操作系统:
- Ubuntu Xenial 16.04 (LTS)
- Ubuntu Wily 15.10
- Ubuntu Trusty 14.04 (LTS)
- Ubuntu Precise 12.04 (LTS)
该页指导你使用Docker管理发行包和安装机制来安装Docker。使用这些包能够确保你获得最新的Docker发行版。如果你希望使用Ubuntu管理包进行安装,可以查阅一个UBuntu资料。
注意:Ubuntu 14.10和15.04存在Docker的APT库,但是并不官方支持。
要求
不管你的Ubuntu版本是什么,Docker要求64位系统安装。除此之外,你的内核最低版本要求为3.10。最近的3.10的较小版本或最新的维护版本都是可以接受的。
更新包信息,确定APT以https
方法工作,并且CA证书已被安装
$ sudo apt-get install apt-transport-https ca-certificates
添加新的GPG
键
$ sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
打开/etc/apt/sources.list.d/docker.list
- 移除所有存在的条目。
-
为你的Ubuntu操作系统添加一个条目。
可能的条目为:-
在Ubuntu Precise 12.04 (LTS)中
- 1
- 1
-
在Ubuntu Trusty 14.04 (LTS)中
- 1
- 1
-
在Ubuntu Wily 15.10中
- 1
- 1
-
在Ubuntu Xenial 16.04(LTS)
-
/etc/apt/sources.list.d/docker.list
- 更新
APT
包索引。
- 1
- 1
- 如果旧的repo存在则清除
- 1
- 1
- 验证
APT
是否是从正确的库中拉取下来的。
apt-get upgrade,APT
会从最新的库中拉取出来
对于Ubuntu Trusty,Wily和Xenial来说,我们推荐您安装linux-image-extra
内核包。linux-image-extra
包允许你使用aufs
存储驱动。
为了给您的内核版本安装linux-image-extra
包:
- 在你的Ubuntu系统中打开一个终端。
- 更新你的包管理器。
- 1
- 1
- 安装推荐的包
- 1
- 1
- 继续安装Docker
如果你正在Ubuntu 14.04或12.04中安装,apparmor
是需要的。你可以使用apt-get install apparmor
来安装它
确定你已经安装了你Ubuntu版本的必要条件。然后,使用下面的命令安装Docker:
- 使用
sudo
特权作为一个用户登陆你的Ubuntu。 - 更新你的
APT
包索引。
- 1
- 1
- 安装Docker。
- 1
- 1
- 开启
docker
域
- 1
- 1
- 验证
docker
被正确安装
该命令会向容器中下载一个测试镜像并且运行它。当容器运行成功,就会打印一个信息,然后退出。
初次安装Docker运行出现的问题。
第一次安装Docker,运行hello-world是可以的,
重启系统之后,运行hello-world出现如下报错:
Cannotconnect to the Docker daemon. Is the docker daemon running on this host?
解决如下:
sudo su- //切换到root
servicedocker start //启动docker service
dockerimages //显示所有images
docker runhello-world //重新运行
使用TensorFlow来识别手写数字
docker run-it -p 8888:8888 tensorflow/tensorflow:0.12.0-rc0
Go to yourbrowser on http://localhost:8888/
参考
http://blog.csdn.net/hongbochen1223/article/details/51226700
https://docs.docker.com/engine/installation/linux/