mirror of
https://github.com/yeasy/docker_practice.git
synced 2026-03-23 02:13:50 +00:00
Remove redundant English from headings
This commit is contained in:
@@ -252,7 +252,7 @@ $ docker exec myapp python manage.py migrate
|
||||
$ docker exec -it myapp bash
|
||||
OCI runtime exec failed: exec failed: unable to start container process: exec: "bash": executable file not found
|
||||
|
||||
## 解决方案:使用调试容器(Docker Desktop 或 Kubernetes debug)
|
||||
## 解决方案:使用调试容器
|
||||
|
||||
$ docker debug myapp
|
||||
```
|
||||
|
||||
@@ -329,7 +329,7 @@ networks:
|
||||
}
|
||||
```
|
||||
|
||||
#### 自定义服务发现(Service Discovery)
|
||||
#### 自定义服务发现
|
||||
|
||||
**使用 Docker 内建 DNS 的服务发现:**
|
||||
|
||||
@@ -407,7 +407,7 @@ kubectl patch deployment -n kube-system coredns --patch '{
|
||||
}'
|
||||
```
|
||||
|
||||
### 9.7.4 网络策略(NetworkPolicy)实践
|
||||
### 9.7.4 网络策略实践
|
||||
|
||||
网络策略定义了容器间的流量控制规则,是微服务架构中的安全基础。
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
## 10.1 BuildKit
|
||||
|
||||
**BuildKit** 是下一代的镜像构建组件,在 https://github.com/moby/buildkit 开源。
|
||||
**BuildKit** 是下一代的镜像构建组件,在 [moby/buildkit](https://github.com/moby/buildkit) 开源。
|
||||
|
||||
> **重要**:自 Docker 23.0 起,BuildKit 已成为 **默认稳定构建器**,无需手动启用。Docker Engine v29 进一步将 Containerd 镜像存储设为默认,提升与 Kubernetes 的互操作性。
|
||||
|
||||
目前,Docker Hub 自动构建已经支持 BuildKit,具体请参考 https://github.com/docker-practice/docker-hub-buildx
|
||||
目前,Docker Hub 自动构建已经支持 BuildKit,具体请参考 [docker-practice/docker-hub-buildx](https://github.com/docker-practice/docker-hub-buildx)。
|
||||
|
||||
### 10.1.1 `Dockerfile` 新增指令详解
|
||||
|
||||
|
||||
@@ -49,4 +49,4 @@ $ docker buildx build --sbom=true -t myimage .
|
||||
|
||||
### 10.2.2 官方文档
|
||||
|
||||
* https://docs.docker.com/engine/reference/commandline/buildx/
|
||||
* [Docker buildx 命令文档](https://docs.docker.com/engine/reference/commandline/buildx/)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
`Compose` 项目是 Docker 官方的开源项目,负责实现对 Docker 容器集群的快速编排。从功能上看,跟 `OpenStack` 中的 `Heat` 十分类似。
|
||||
|
||||
其代码目前在 [https://github.com/docker/compose](https://github.com/docker/compose) 上开源。
|
||||
其代码目前在 [docker/compose 仓库](https://github.com/docker/compose) 上开源。
|
||||
|
||||
`Compose` 定位是 “定义和运行多个 Docker 容器的应用 (Defining and running multi-container Docker applications)”,其前身是开源项目 Fig。
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
### 关键组件说明
|
||||
|
||||
#### LXC(Linux 容器)
|
||||
#### LXC
|
||||
|
||||
Docker 早期版本(0.1-0.7)直接使用 LXC 作为容器运行时,利用 Linux Namespaces 和 Cgroups 实现容器隔离。
|
||||
|
||||
|
||||
@@ -200,7 +200,7 @@ grype sbom:sbom.json --add-cpes-if-none
|
||||
|
||||
通过分析 SBOM 中的依赖版本,制定安全升级计划。
|
||||
|
||||
### 18.6.3 镜像签名与验证(Cosign/Notary)
|
||||
### 18.6.3 镜像签名与验证
|
||||
|
||||
镜像签名确保镜像的来源可信且未被篡改。两种主流方案是 Cosign 和 Notary。
|
||||
|
||||
@@ -262,7 +262,7 @@ cosign verify myregistry.com/myapp:v1.0.0 \
|
||||
--certificate-oidc-issuer https://token.actions.githubusercontent.com
|
||||
```
|
||||
|
||||
#### Docker Content Trust(DCT)与 Notary
|
||||
#### Docker Content Trust 与 Notary
|
||||
|
||||
Docker Content Trust 使用 Notary 实现镜像签名,是 Docker 官方的签名解决方案。
|
||||
|
||||
@@ -353,7 +353,7 @@ scan_on_push: true # 推送时自动扫描
|
||||
scan_all: true # 扫描仓库中的所有镜像
|
||||
```
|
||||
|
||||
#### 5. 政策执行(Admission Controller)
|
||||
#### 5. 政策执行
|
||||
|
||||
在 Kubernetes 环境中使用 Admission Webhook 强制镜像签名和扫描:
|
||||
|
||||
|
||||
16
README.md
16
README.md
@@ -24,8 +24,8 @@
|
||||
1. **安装 Docker**(第1章):根据操作系统完成 Docker 的安装与验证
|
||||
2. **第一个容器**:执行 `docker run hello-world`,体验最简单的容器运行
|
||||
3. **交互式容器**:执行 `docker run -it ubuntu bash`,进入容器内部与系统交互
|
||||
4. **镜像与仓库**(第2-3章):理解镜像的概念、查找镜像、拉取和使用官方镜像
|
||||
5. **自定义镜像**(第5章):学习如何编写 Dockerfile 创建自己的镜像
|
||||
4. **镜像与仓库**(第2章):理解镜像的概念、查找镜像、拉取和使用官方镜像
|
||||
5. **自定义镜像**(第7章):学习如何编写 Dockerfile 创建自己的镜像
|
||||
|
||||
## 学习路线图
|
||||
|
||||
@@ -57,9 +57,9 @@ graph LR
|
||||
|
||||
### 在线阅读
|
||||
|
||||
* **GitBook**: [yeasy.gitbook.io/docker_practice](https://yeasy.gitbook.io/docker_practice/)
|
||||
* **GitHub**: [github.com/yeasy/docker_practice](https://github.com/yeasy/docker_practice/blob/master/SUMMARY.md)
|
||||
* **Mirror**: [docker-practice.com](https://vuepress.mirror.docker-practice.com/)
|
||||
* **GitBook**: [在线阅读](https://yeasy.gitbook.io/docker_practice/)
|
||||
* **GitHub**: [仓库目录](https://github.com/yeasy/docker_practice/blob/master/SUMMARY.md)
|
||||
* **Mirror**: [镜像站点](https://vuepress.mirror.docker-practice.com/)
|
||||
|
||||
### 本地阅读
|
||||
|
||||
@@ -72,8 +72,8 @@ graph LR
|
||||
```bash
|
||||
docker run -it --rm -p 4000:80 ccr.ccs.tencentyun.com/dockerpracticesig/docker_practice:vuepress
|
||||
```
|
||||
启动后访问 [http://localhost:4000](http://localhost:4000)。
|
||||
[详情参考](https://github.com/yeasy/docker_practice/wiki/%E7%A6%BB%E7%BA%BF%E9%98%85%E8%AF%BB%E5%8A%9F%E8%83%BD%E8%AF%A6%E8%A7%A3)
|
||||
启动后访问 [本地阅读地址](http://localhost:4000)。
|
||||
[离线阅读说明](https://github.com/yeasy/docker_practice/wiki/%E7%A6%BB%E7%BA%BF%E9%98%85%E8%AF%BB%E5%8A%9F%E8%83%BD%E8%AF%A6%E8%A7%A3)
|
||||
|
||||
#### 方式 2:本地构建
|
||||
|
||||
@@ -83,7 +83,7 @@ docker run -it --rm -p 4000:80 ccr.ccs.tencentyun.com/dockerpracticesig/docker_p
|
||||
npm install
|
||||
npx honkit serve
|
||||
```
|
||||
启动后访问 [http://localhost:4000](http://localhost:4000)。
|
||||
启动后访问 [本地阅读地址](http://localhost:4000)。
|
||||
|
||||
## 社区交流
|
||||
|
||||
|
||||
@@ -340,4 +340,4 @@ $ docker run --rm -it postgres bash
|
||||
|
||||
### 官方镜像示例
|
||||
|
||||
这些官方镜像的 Dockerfile 都是参考典范:https://github.com/docker-library/docs
|
||||
这些官方镜像的 Dockerfile 都是参考典范,详见 [docker-library/docs](https://github.com/docker-library/docs)。
|
||||
|
||||
@@ -40,4 +40,4 @@ $ docker run -it --rm \
|
||||
|
||||
### Dockerfile
|
||||
|
||||
请到 https://github.com/docker-library/docs/tree/master/mongo 查看。
|
||||
请到 [Mongo 官方镜像文档目录](https://github.com/docker-library/docs/tree/master/mongo) 查看。
|
||||
|
||||
@@ -39,4 +39,4 @@ $ docker run -it --rm \
|
||||
|
||||
### Dockerfile
|
||||
|
||||
请到 https://github.com/docker-library/docs/tree/master/node 查看。
|
||||
请到 [Node 官方镜像文档目录](https://github.com/docker-library/docs/tree/master/node) 查看。
|
||||
|
||||
@@ -35,4 +35,4 @@ $ docker run --name some-wordpress -d --network my-wordpress-net -e WORDPRESS_DB
|
||||
|
||||
### Dockerfile
|
||||
|
||||
请到 https://github.com/docker-library/docs/tree/master/wordpress 查看。
|
||||
请到 [WordPress 官方镜像文档目录](https://github.com/docker-library/docs/tree/master/wordpress) 查看。
|
||||
|
||||
Reference in New Issue
Block a user