Skip to content

Commit ea00e0d

Browse files
committed
Update format
Signed-off-by: Kang Huaishuai <[email protected]>
1 parent 5ebd6fb commit ea00e0d

27 files changed

+39
-15
lines changed

.github/workflows/ci.yaml

+13-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55

66
name: CI
77

8+
defaults:
9+
run:
10+
shell: bash --noprofile --norc -exo pipefail {0}
11+
812
jobs:
913
build:
1014
name: Build
@@ -39,7 +43,10 @@ jobs:
3943
docker run -d --rm -p 4000:80 dockerpracticesig/docker_practice
4044
4145
sleep 5
46+
47+
echo "::group::Test"
4248
curl 127.0.0.1:4000
49+
echo "::endgroup::"
4350
4451
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
4552
docker push dockerpracticesig/docker_practice
@@ -139,9 +146,13 @@ jobs:
139146
140147
docker push dockerpracticesig/docker_practice:vuepress
141148
142-
docker run -it --rm -d -p 4000:80 dockerpracticesig/docker_practice:vuepress
149+
docker run -it --rm -d -p 4001:80 dockerpracticesig/docker_practice:vuepress
143150
144-
curl 127.0.0.1:4000
151+
sleep 5
152+
153+
echo "::group::Test"
154+
curl 127.0.0.1:4001
155+
echo "::endgroup::"
145156
env:
146157
DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}}
147158
DOCKER_USERNAME: ${{secrets.DOCKER_USERNAME}}

advanced_network/access_control.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# 容器访问控制
2+
23
容器的访问控制,主要通过 Linux 上的 `iptables` 防火墙来进行管理和实现。`iptables` 是 Linux 上默认的防火墙软件,在大部分发行版中都自带。
34

45
## 容器访问外部网络

advanced_network/example.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# 工具和示例
2+
23
在介绍自定义网络拓扑之前,你可能会对一些外部工具和例子感兴趣:
34

45
## pipework

basic_concept/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# 基本概念
2+
23
Docker 包括三个基本概念
34
* 镜像(`Image`
45
* 容器(`Container`

cases/os/debian.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Debian/Ubuntu
2+
23
`Debian``Ubuntu` 都是目前较为流行的 **Debian 系** 的服务器操作系统,十分适合研发场景。`Docker Hub` 上提供了官方镜像,国内各大容器云服务也基本都提供了相应的支持。
34

45
## Debian 系统简介

container/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# 操作 Docker 容器
2+
23
容器是 Docker 又一核心概念。
34

45
简单的说,容器是独立运行的一个或一组应用,以及它们的运行态环境。对应的,虚拟机可以理解为模拟运行的一整套操作系统(提供了运行态环境和其他系统环境)和跑在上面的应用。

image/dockerfile/add.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### ADD 更高级的复制文件
1+
# ADD 更高级的复制文件
22

33
`ADD` 指令和 `COPY` 的格式和性质基本一致。但是在 `COPY` 基础上增加了一些功能。
44

image/dockerfile/arg.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### ARG 构建参数
1+
# ARG 构建参数
22

33
格式:`ARG <参数名>[=<默认值>]`
44

image/dockerfile/cmd.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### CMD 容器启动命令
1+
# CMD 容器启动命令
22

33
`CMD` 指令的格式和 `RUN` 相似,也是两种格式:
44

image/dockerfile/copy.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### COPY 复制文件
1+
# COPY 复制文件
22

33
格式:
44

image/dockerfile/entrypoint.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### ENTRYPOINT 入口点
1+
# ENTRYPOINT 入口点
22

33
`ENTRYPOINT` 的格式和 `RUN` 指令格式一样,分为 `exec` 格式和 `shell` 格式。
44

image/dockerfile/env.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### ENV 设置环境变量
1+
# ENV 设置环境变量
22

33
格式有两种:
44

image/dockerfile/expose.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### EXPOSE 声明端口
1+
# EXPOSE 声明端口
22

33
格式为 `EXPOSE <端口1> [<端口2>...]`
44

image/dockerfile/healthcheck.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### HEALTHCHECK 健康检查
1+
# HEALTHCHECK 健康检查
22

33
格式:
44

image/dockerfile/onbuild.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### ONBUILD 为他人做嫁衣裳
1+
# ONBUILD 为他人做嫁衣裳
22

33
格式:`ONBUILD <其它指令>`
44

image/dockerfile/references.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### 参考文档
1+
# 参考文档
22

33
* `Dockerfie` 官方文档:https://docs.docker.com/engine/reference/builder/
44

image/dockerfile/user.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### USER 指定当前用户
1+
# USER 指定当前用户
22

33
格式:`USER <用户名>[:<用户组>]`
44

image/dockerfile/volume.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### VOLUME 定义匿名卷
1+
# VOLUME 定义匿名卷
22

33
格式为:
44

image/dockerfile/workdir.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### WORKDIR 指定工作目录
1+
# WORKDIR 指定工作目录
22

33
格式为 `WORKDIR <工作目录路径>`
44

introduction/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# 简介
2+
23
本章将带领你进入 **Docker** 的世界。
34

45
什么是 **Docker**

security/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# 安全
2+
23
评估 Docker 的安全性时,主要考虑三个方面:
34

45
* 由内核的命名空间和控制组机制提供的容器内在安全

security/control_group.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# 控制组
2+
23
控制组是 Linux 容器机制的另外一个关键组件,负责实现资源的审计和限制。
34

45
它提供了很多有用的特性;以及确保各个容器可以公平地分享主机的内存、CPU、磁盘 IO 等资源;当然,更重要的是,控制组确保了当容器内的资源使用产生压力时不会连累主机系统。

security/daemon_sec.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Docker服务端的防护
2+
23
运行一个容器或应用程序的核心是通过 Docker 服务端。Docker 服务的运行目前需要 root 权限,因此其安全性十分关键。
34

45
首先,确保只有可信的用户才可以访问 Docker 服务。Docker 允许用户在主机和容器间共享文件夹,同时不需要限制容器的访问权限,这就容易让容器突破资源限制。例如,恶意用户启动容器的时候将主机的根目录`/`映射到容器的 `/host` 目录中,那么容器理论上就可以对主机的文件系统进行任意修改了。这听起来很疯狂?但是事实上几乎所有虚拟化系统都允许类似的资源共享,而没法禁止用户共享主机根文件系统到虚拟机系统。

security/kernel_ns.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# 内核命名空间
2+
23
Docker 容器和 LXC 容器很相似,所提供的安全特性也差不多。当用 `docker run` 启动一个容器时,在后台 Docker 为容器创建了一个独立的命名空间和控制组集合。
34

45
命名空间提供了最基础也是最直接的隔离,在容器中运行的进程不会被运行在主机上的进程和其它容器发现和作用。

security/other_feature.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# 其它安全特性
2+
23
除了能力机制之外,还可以利用一些现有的安全机制来增强使用 Docker 的安全性,例如 TOMOYO, AppArmor, Seccomp, SELinux, GRSEC 等。
34

45
Docker 当前默认只启用了能力机制。用户可以采用多种方案来加强 Docker 主机的安全,例如:

security/summary.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# 总结
2+
23
总体来看,Docker 容器还是十分安全的,特别是在容器内不使用 root 权限来运行进程的话。
34

45
另外,用户可以使用现有工具,比如 [Apparmor](https://docs.docker.com/engine/security/apparmor/), [Seccomp](https://docs.docker.com/engine/security/seccomp/), SELinux, GRSEC 来增强安全性;甚至自己在内核中实现更复杂的安全机制。

underly/namespace.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# 命名空间
2+
23
命名空间是 Linux 内核一个强大的特性。每个容器都有自己单独的命名空间,运行在其中的应用都像是在独立的操作系统中运行一样。命名空间保证了容器之间彼此互不影响。
34

45
## pid 命名空间

0 commit comments

Comments
 (0)