Restruct and start rewring.

This commit is contained in:
Baohua Yang
2014-09-15 17:08:06 +08:00
parent f14fddbba8
commit 80eda65481
16 changed files with 95 additions and 78 deletions

View File

@@ -1,4 +1,4 @@
##创建我们自己的images
##创建镜像
别人的镜像虽然好,但不一定适合我们。
我们可以对这些镜像做一些修改有2个方法利用现成的镜像进行修改或者利用dockerfile创建。

10
image/internal.md Normal file
View File

@@ -0,0 +1,10 @@
##工作原理
docker image是怎么实现增量的修改和维护的
每个docker都有很多层次构成docker使用 [Union FS](http://en.wikipedia.org/wiki/UnionFS) 将这些不同的层结合到一个image中去。
Union FS是一种特殊的文件系统它支持将不同目录挂载到同一个虚拟文件系统下(unite several directories into a single virtual filesystem),
AUFS (AnotherUnionFS) 就是一种 Union FS, AUFS支持为每一个成员目录(类似Git Branch)设定readonly、readwrite 和 whiteout-able 权限, 同时 AUFS 里有一个类似分层的概念, 对 readonly 权限的 branch 可以逻辑上进行修改(增量地, 不影响 readonly 部分的)。
通常 Union FS 有两个用途, 一方面可以实现不借助 LVM、RAID 将多个disk挂到同一个目录下, 另一个更常用的就是将一个 readonly 的 branch 和一个 writeable 的 branch 联合在一起Live CD正是基于此方法可以允许在 OS image 不变的基础上允许用户在其上进行一些写操作。
Docker 在 AUFS 上构建的 container image 也正是如此。

View File

@@ -1,4 +1,4 @@
##使用docker push上传images
##上传镜像
用户也可以把自己创建的image上传到docker hub中来共享。
```
$ sudo docker push ouruser/sinatra

View File

@@ -1,4 +1,4 @@
##用docker rmi 移除本地images
##移除本地镜像
如果要移除本地的image可以使用rmi命令。注意rm命令是移除容器。
```
$ sudo docker rmi training/sinatra