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

@@ -22,7 +22,6 @@ Podman 支持多种操作系统,安装过程也相对简单。
```bash
$ sudo yum -y install podman
```
#### macOS
macOS 上需要安装 Podman Desktop 或通过 Homebrew 安装
@@ -32,7 +31,6 @@ $ brew install podman
$ podman machine init
$ podman machine start
```
### 17.3.3 基本使用
`podman` 的命令行几乎与 `docker` 完全兼容大多数情况下你只需将 `docker` 替换为 `podman` 即可
@@ -40,30 +38,25 @@ $ podman machine start
#### 运行容器
```bash
## $ docker run -d -p 80:80 nginx:alpine
$ podman run -d -p 80:80 nginx:alpine
```
#### 列出容器
```bash
$ podman ps
```
#### 构建镜像
```bash
$ podman build -t myimage .
```
### 17.3.4 Pods 的概念
Docker 不同Podman 支持Pod的概念 (类似于 Kubernetes Pod)允许你在同一个网络命名空间中运行多个容器
```bash
## 创建一个 Pod
$ podman pod create --name mypod -p 8080:80
@@ -72,7 +65,6 @@ $ podman pod create --name mypod -p 8080:80
$ podman run -d --pod mypod --name webbing nginx
```
### 17.3.5 迁移到 Podman
如果你习惯使用 `docker` 命令可以简单地设置别名
@@ -80,13 +72,11 @@ $ podman run -d --pod mypod --name webbing nginx
```bash
$ alias docker=podman
```
#### Systemd 集成
Podman 可以生成 systemd 单元文件让容器像普通系统服务一样管理
```bash
## 创建容器
$ podman run -d --name myweb -p 8080:80 nginx
@@ -99,7 +89,6 @@ $ podman generate systemd --name myweb --files --new
$ systemctl --user enable --now container-myweb.service
```
#### Podman Compose
虽然 Podman 兼容 Docker Compose但在某些场景下你可能需要明确使用 `podman-compose`