mirror of
https://github.com/yeasy/docker_practice.git
synced 2026-03-26 03:35:31 +00:00
Add blank lines around headers
This commit is contained in:
@@ -26,6 +26,7 @@ passwd:
|
||||
```bash
|
||||
$ docker run -i --rm quay.io/coreos/fcct:v0.5.0 --pretty --strict < example.fcc > example.ign
|
||||
```
|
||||
|
||||
### 17.2.4 挂载 ISO 启动虚拟机并安装
|
||||
|
||||
> 虚拟机需要分配 3GB 以上内存,否则会无法启动。
|
||||
|
||||
@@ -22,6 +22,7 @@ Podman 支持多种操作系统,安装过程也相对简单。
|
||||
```bash
|
||||
$ sudo yum -y install podman
|
||||
```
|
||||
|
||||
#### macOS
|
||||
|
||||
macOS 上需要安装 Podman Desktop 或通过 Homebrew 安装:
|
||||
@@ -31,6 +32,7 @@ $ brew install podman
|
||||
$ podman machine init
|
||||
$ podman machine start
|
||||
```
|
||||
|
||||
### 17.3.3 基本使用
|
||||
|
||||
`podman` 的命令行几乎与 `docker` 完全兼容,大多数情况下,你只需将 `docker` 替换为 `podman` 即可。
|
||||
@@ -42,16 +44,19 @@ $ podman machine start
|
||||
|
||||
$ 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),允许你在同一个网络命名空间中运行多个容器。
|
||||
@@ -65,6 +70,7 @@ $ podman pod create --name mypod -p 8080:80
|
||||
|
||||
$ podman run -d --pod mypod --name webbing nginx
|
||||
```
|
||||
|
||||
### 17.3.5 迁移到 Podman
|
||||
|
||||
如果你习惯使用 `docker` 命令,可以简单地设置别名:
|
||||
@@ -72,6 +78,7 @@ $ podman run -d --pod mypod --name webbing nginx
|
||||
```bash
|
||||
$ alias docker=podman
|
||||
```
|
||||
|
||||
#### Systemd 集成
|
||||
|
||||
Podman 可以生成 systemd 单元文件,让容器像普通系统服务一样管理。
|
||||
@@ -89,6 +96,7 @@ $ podman generate systemd --name myweb --files --new
|
||||
|
||||
$ systemctl --user enable --now container-myweb.service
|
||||
```
|
||||
|
||||
#### Podman Compose
|
||||
|
||||
虽然 Podman 兼容 Docker Compose,但在某些场景下你可能需要明确使用 `podman-compose`。
|
||||
|
||||
@@ -30,6 +30,7 @@ $ sudo dnf install -y buildah
|
||||
$ sudo apt-get update
|
||||
$ sudo apt-get -y install buildah
|
||||
```
|
||||
|
||||
### 基础用法示例
|
||||
|
||||
#### 1. 从现有的 Dockerfile 构建镜像
|
||||
|
||||
@@ -35,6 +35,7 @@ $ sudo apt-get -y install skopeo
|
||||
```bash
|
||||
$ brew install skopeo
|
||||
```
|
||||
|
||||
### 基础用法示例
|
||||
|
||||
#### 1. 远程检查镜像
|
||||
|
||||
Reference in New Issue
Block a user