Minor update ignore file; Add pull_all and push_all scripts

pull/24/merge
Baohua Yang 2014-10-30 15:30:51 +08:00
parent f936efebd9
commit fda6a07a1e
6 changed files with 31 additions and 5 deletions

1
.gitignore vendored
View File

@ -3,3 +3,4 @@
*.tmp
.idea/
_book/
*.swp

13
_local/pull_all.sh Normal file
View File

@ -0,0 +1,13 @@
#!/bin/sh
# This script will update all local images
# See: https://github.com/yeasy/docker_practice/blob/master/_local/pull_all.sh
# Usage: pull_all
# Author: yeasy@github
# Create: 2014-09-23
for image in `sudo docker images|grep -v "REPOSITORY"|grep -v "<none>"|awk '{print $1":"$2}'`
do
sudo docker pull $image
done

12
_local/push_all.sh Normal file
View File

@ -0,0 +1,12 @@
#!/bin/sh
# This script will upload all local images to a registry server ($registry is the default value).
# This script requires the push_images, which can be found at https://github.com/yeasy/docker_practice/blob/master/_local/push_images.sh
# Usage: push_all
# Author: yeasy@github
# Create: 2014-09-23
for image in `sudo docker images|grep -v "REPOSITORY"|grep -v "<none>"|awk '{print $1":"$2}'`
do
push_images $image
done

View File

@ -48,7 +48,7 @@ ENV PATH /usr/local/postgres-$PG_MAJOR/bin:$PATH
格式为 `ADD <src> <dest>`
该命令将复制指定的 `<src>` 到容器中的 `<dest>`
其中 `<src>` 可以是Dockerfile所在目录的一个相对路径也可以是一个 URL还可以是一个 tar 文件(自动解压为目录)。则。
其中 `<src>` 可以是Dockerfile所在目录的一个相对路径也可以是一个 URL还可以是一个 tar 文件(自动解压为目录)。
### COPY
格式为 `COPY <src> <dest>`

View File

@ -51,10 +51,10 @@ $ sudo python-pip install docker-registry
```
$ sudo apt-get install build-essential python-dev libevent-dev python-pip libssl-dev liblzma-dev libffi-dev
$ git clone https://github.com/docker/docker-registry.git
$ cd git-registry
$ sudo pip install .
$ cd docker-registry
$ sudo python setup.py install
```
然后修改配置文件主要修改dev模板段的 `storage_path` 到本地的存储仓库的路径。
然后修改配置文件,主要修改 dev 模板段的 `storage_path` 到本地的存储仓库的路径。
```
$ cp config/config_sample.yml config/config.yml
```

View File

@ -1,7 +1,7 @@
## 内核能力机制
能力机制Capability是 Linux 内核一个强大的特性,可以提供细粒度的权限访问控制。
Linux 内核自 2.1 版本起就支持能力机制,它将权限划分为更加细粒度的操作能力,既可以作用在进程上,也可以作用在文件上。
Linux 内核自 2.2 版本起就支持能力机制,它将权限划分为更加细粒度的操作能力,既可以作用在进程上,也可以作用在文件上。
例如,一个 Web 服务进程只需要绑定一个低于 1024 的端口的权限,并不需要 root 权限。那么它只需要被授权 `net_bind_service` 能力即可。此外,还有很多其他的类似能力来避免进程获取 root 权限。