Remove blank lines after code block markers

This commit is contained in:
yeasy
2026-03-21 22:36:09 -07:00
parent 312f8fea42
commit 9ac19d79ee
132 changed files with 0 additions and 1517 deletions

View File

@@ -24,14 +24,12 @@ Buildah 由 Red Hat 主导开发,通常和 Podman、Skopeo 一起使用,被
```bash
$ sudo dnf install -y buildah
```
Ubuntu/Debian 为例需引入官方源后
```bash
$ sudo apt-get update
$ sudo apt-get -y install buildah
```
### 基础用法示例
#### 1. 从现有的 Dockerfile 构建镜像
@@ -41,7 +39,6 @@ Buildah 最常见的用法就是像 Docker 一样根据 `Dockerfile` 来构建
```bash
$ buildah bud -t my-app:latest .
```
可以看到在这点上它与 `docker build` 的体验完全一致
#### 2. 交互式从空镜像开始构建
@@ -49,7 +46,6 @@ $ buildah bud -t my-app:latest .
除了使用 DockerfileBuildah 最强大的功能来自于它的交互式和脚本化构建机制我们可以从一个极简的镜像或基础镜像开始构建
```bash
# 获取一个基础镜像
$ container=$(buildah from alpine:latest)
@@ -71,7 +67,6 @@ $ buildah commit $container my-hello-image:latest
$ buildah unmount $container
$ buildah rm $container
```
这种模式在自动化流水线中极为有用因为我们可以将上述过程编写成标准的 bash 脚本无需为了构建镜像而撰写只在其独立语法中运行的 Dockerfile 指令
#### 3. 查看和推送镜像
@@ -79,12 +74,10 @@ $ buildah rm $container
通过 `buildah images` 可以查看当前环境中的镜像推送镜像到外部 Registry 也十分安全方便
```bash
# 查看本地构建的镜像
$ buildah images
# 推送镜像到 Docker Hub注意需要先登录
$ buildah push my-hello-image:latest docker://docker.io/username/my-hello-image:latest
```
结合其无需特权和灵活脚本的优点Buildah 正变得越来越受到构建和分发 OCI 镜像的用户喜爱