containers/podman
GitHub: containers/podman
一款无守护进程、原生支持 rootless 的 OCI 容器和 Pod 管理工具,Docker 的安全增强型替代方案。
Stars: 31010 | Forks: 3014

# Podman:一款用于管理 OCI 容器和 Pod 的工具


[](https://goreportcard.com/report/github.com/containers/podman/v6)
[](https://www.bestpractices.dev/projects/10499)
[](https://insights.linuxfoundation.org/project/podman-container-tools/repository/containers-podman)
[](https://insights.linuxfoundation.org/project/podman-container-tools/repository/containers-podman)
Podman(POD MANager)是一款用于管理容器和镜像、挂载到这些容器的卷以及由容器组构成的 Pod 的工具。 Podman 在 Linux 上运行容器,但也可以在 Mac 和 Windows 系统上通过 Podman 管理的虚拟机使用。 Podman 基于 libpod,这是一个用于容器生命周期管理的库,也包含在本仓库中。libpod 库提供了用于管理容器、Pod、容器镜像和卷的 API。 Podman 每年发布 4 次主要或次要版本,时间分别在 2 月、5 月、8 月和 11 月的第二周。补丁发布更为频繁,可能随时进行以向用户提供错误修复。所有版本均经过 PGP 签名。获准进行发布的团队成员的公钥位于[此处](https://github.com/containers/release-keys/tree/main/podman)。 * 持续集成: * [](https://cirrus-ci.com/github/containers/podman/main) * [GoDoc: ](https://godoc.org/github.com/containers/podman/libpod) * [下载](DOWNLOADS.md) ## 概述与范围 从宏观角度来看,Podman 和 libdoc 的范围如下: * 支持多种容器镜像格式,包括 OCI 和 Docker 镜像。 * 对这些镜像的全面管理,包括从各种来源拉取(包括信任和验证)、创建(通过 Containerfile 或 Dockerfile 构建或从容器提交)以及推送到注册表和其他存储后端。 * 容器生命周期的全面管理,包括创建(从镜像和从解压的根文件系统)、运行、检查点和恢复(通过 CRIU)以及移除。 * 使用 Netavark 进行容器网络的全面管理。 * 支持 Pod,即共享资源并一起管理的容器组。 * 支持在无 root 或其他提升权限的情况下运行容器和 Pod。 * 容器和 Pod 的资源隔离。 * 支持兼容 Docker 的 CLI 接口,既可以在本地也可以在远程系统上运行容器。 * 无管理守护进程,提高了安全性并降低了空闲时的资源利用率。 * 支持 REST API,提供兼容 Docker 的接口和展示高级 Podman 功能的改进接口。 * 支持通过 `podman machine` 运行的虚拟机在 Windows 和 Mac 上运行。 ## 路线图 Podman 功能开发的未来规划可在其**[路线图](ROADMAP.md)**中找到。 ## 沟通交流 如果您认为在项目中发现了安全问题,请*不要*通过 GitHub issue 跟踪器、邮件列表或 IRC 公开报告该问题。 相反,请发送一封包含尽可能多详细信息的电子邮件至 `security@lists.podman.io`。这是一个供核心维护者使用的私人邮件列表。 对于一般性问题和讨论,请使用 Podman 的 [渠道](https://podman.io/community/#slack-irc-matrix-and-discord)。 有关问题/错误和功能的讨论,您可以使用 GitHub [issues](https://github.com/containers/podman/issues) 和 [PRs](https://github.com/containers/podman/pulls) 跟踪系统。 此外还有一个位于 `lists.podman.io` 的[邮件列表](https://lists.podman.io/archives/)。 您可以通过向 `podman-join@lists.podman.io` 发送主题为 `subscribe` 的消息来订阅。 ## Rootless(无根模式) Podman 可以轻松地以普通用户身份运行,无需 setuid 二进制文件。 当在没有 root 的情况下运行时,Podman 容器使用用户命名空间将容器中的 root 设置为运行 Podman 的用户。 Rootless Podman 运行受限的容器,这些容器不具备运行容器的用户所没有的权限。 其中一些限制可以被解除(例如通过 `--privileged`),但 rootless 容器永远不会拥有比启动它们的用户更多的权限。 如果您以自己的用户身份运行 Podman 并从主机挂载 `/etc/passwd`,您仍然无法更改它,因为您的用户没有这样做的权限。 几乎所有正常的 Podman 功能都可用,尽管存在一些[不足之处](https://github.com/containers/podman/blob/main/rootless.md)。 任何最新的 Podman 版本都应该能够在无需额外配置的情况下运行 rootless,尽管您的操作系统可能需要一些额外的配置,详见[安装指南](https://podman.io/getting-started/installation)。 在使用 rootless Podman 之前,管理员需要进行少量配置,必要的设置记录在[此处](https://github.com/containers/podman/blob/main/docs/tutorials/rootless_tutorial.md)。 ## Podman Desktop [Podman Desktop](https://podman-desktop.io/) 为 Linux、Windows 和 Mac 机器上的 Podman 和 Kubernetes 提供了本地开发环境。 它是 Podman 的全功能桌面 UI 前端,在非 Linux 操作系统上使用 `podman machine` 后端来运行容器。 它支持完整的容器生命周期管理(构建、拉取和推送镜像,创建和管理容器,创建和管理 Pod,以及处理 Kubernetes YAML)。 该项目在 [GitHub](https://github.com/containers/podman-desktop) 上开发,欢迎贡献。 ## 超出范围 * 专门的签名并将镜像推送到各种存储后端。 有关这些任务,请参阅 [Skopeo](https://github.com/containers/skopeo/)。 * 支持 Kubernetes CRI 接口进行容器管理。 [CRI-O](https://github.com/cri-o/cri-o) 守护进程专攻于此。 ## OCI 项目计划 Podman 在不同方面使用 OCI 项目和同类最佳的库: - Runtime:我们使用 [OCI runtime tools](https://github.com/opencontainers/runtime-tools) 生成 OCI runtime 配置,这些配置可与任何兼容 OCI 的 runtime 一起使用,例如 [crun](https://github.com/containers/crun/) 和 [runc](https://github.com/opencontainers/runc/)。 - 镜像:镜像管理使用 [containers/image](https://github.com/containers/image) 库。 - 存储:容器和镜像存储由 [containers/storage](https://github.com/containers/storage) 管理。 - 网络:通过网络使用 [Netavark](https://github.com/containers/netavark) 和 [Aardvark](https://github.com/containers/aardvark-dns) 提供支持。Rootless 网络通过 [pasta](https://passt.top/passt) 或 [slirp4netns](https://github.com/rootless-containers/slirp4netns) 处理。 - 构建:通过 [Buildah](https://github.com/containers/buildah) 支持构建。 - Conmon:[Conmon](https://github.com/containers/conmon) 是一个用于监控 OCI runtime 的工具,被 Podman 和 CRI-O 共同使用。 - Seccomp:Podman、Buildah 和 CRI-O 的统一 [Seccomp](https://github.com/containers/container-libs/blob/main/common/pkg/seccomp/seccomp.json) 策略。 ## 面向开发者的 Podman 信息 有关博客、发布公告等内容,请查看 [podman.io](https://podman.io) 网站! **[安装说明](install.md)** 有关如何在您的环境中安装 Podman 的信息。 **[OCI Hooks 支持](https://github.com/containers/container-libs/blob/main/common/pkg/hooks/README.md)** 有关 Podman 如何配置 [OCI Hooks][spec-hooks] 以在启动容器时运行的信息。 **[Podman API](https://docs.podman.io/en/latest/_static/api.html)** Podman REST API 文档。 **[Podman 命令](https://podman.readthedocs.io/en/latest/Commands.html)** Podman 命令列表,包含指向其 man pages 的链接,在许多情况下还有展示命令使用的视频。 **[Podman 容器镜像](https://github.com/containers/image_build/blob/main/podman/README.md)** 有关 [quay.io](https://quay.io/podman/stable) 上的 Podman 容器镜像的信息。 **[Podman 故障排除指南](troubleshooting.md)** Podman 常见问题和解决方案列表。 **[Podman 使用迁移](transfer.md)** 与使用 Podman 的基础设施相关的运维和开发迁移有用信息。此页面包含显示 Docker 命令及其 Podman 等效命令的表格。 **[教程](docs/tutorials)** 使用 Podman 的教程。 **[远程客户端](https://github.com/containers/podman/blob/main/docs/tutorials/remote_client.md)** 关于使用 Podman 远程客户端的简要指南。 **[Rootless 环境下 Podman 的基本设置和使用](https://github.com/containers/podman/blob/main/docs/tutorials/rootless_tutorial.md)** 展示运行 Rootless Podman 所需的设置和配置的教程。 **[发布说明](RELEASE_NOTES.md)** 近期 Podman 版本的发布说明。 **[贡献](CONTRIBUTING.md)** 有关为此项目做贡献的信息。 ## Buildah 和 Podman 的关系 Buildah 和 Podman 是两个互补的开源项目, 可在大多数 Linux 平台上使用,这两个项目都位于 [GitHub.com](https://github.com),Buildah 在[此处](https://github.com/containers/buildah),Podman 在 [此处](https://github.com/containers/podman)。Buildah 和 Podman 都是 在 Open Container Initiative (OCI) 镜像和容器上工作的命令行工具。 这两个项目在专业化方面有所不同。 Buildah 专攻构建 OCI 镜像。Buildah 的命令复制了 Dockerfile 中的所有命令。这允许在不需要任何 root 权限的情况下 使用和不使用 Dockerfile 构建镜像。 Buildah 的最终目标是提供一个底层的 coreutils 接口来 构建镜像。在没有 Dockerfile 的情况下构建镜像的灵活性允许 将其他脚本语言集成到构建过程中。 Buildah 遵循简单的 fork-exec 模型,不作为守护进程运行, 但它基于 golang 中的综合 API,可以被 vendored 到其他工具中。 Podman 专攻所有帮助您维护和修改 OCI 镜像的命令和功能, 例如拉取和标记。它还允许您创建、运行和维护从这些镜像创建的容器。 为了通过 Dockerfile 构建容器镜像,Podman 使用 Buildah 的 golang API,并且可以独立于 Buildah 安装。 Podman 和 Buildah 之间的一个主要区别是它们对容器的概念。Podman 允许用户创建“传统容器”,这些容器的意图是 长期存在的。而 Buildah 容器实际上只是为了允许将内容 添加回容器镜像而创建的。一个简单的思考方式是, `buildah run` 命令模拟 Dockerfile 中的 RUN 命令,而 `podman run` 命令在功能上模拟 `docker run` 命令。因此以及它们底层的 存储差异,您无法在 Buildah 中看到 Podman 容器,反之亦然。 简而言之,Buildah 是创建 OCI 镜像的有效方式,而 Podman 允许 您在生产环境中使用熟悉的容器 cli 命令管理和维护这些镜像和容器。 欲知更多详情,请参阅 [Container Tools Guide](https://github.com/containers/buildah/tree/main/docs/containertools)。 ## Podman Hello ``` $ podman run quay.io/podman/hello Trying to pull quay.io/podman/hello:latest... Getting image source signatures Copying blob a6b3126f3807 done Copying config 25c667d086 done Writing manifest to image destination Storing signatures !... Hello Podman World ...! .--"--. / - - \ / (O) (O) \ ~~~| -=(,Y,)=- | .---. /` \ |~~ ~/ o o \~~~~.----. ~~ | =(X)= |~ / (O (O) \ ~~~~~~~ ~| =(Y_)=- | ~~~~ ~~~| U |~~ Project: https://github.com/containers/podman Website: https://podman.io Documents: https://docs.podman.io Twitter: @Podman_io ```
Podman(POD MANager)是一款用于管理容器和镜像、挂载到这些容器的卷以及由容器组构成的 Pod 的工具。 Podman 在 Linux 上运行容器,但也可以在 Mac 和 Windows 系统上通过 Podman 管理的虚拟机使用。 Podman 基于 libpod,这是一个用于容器生命周期管理的库,也包含在本仓库中。libpod 库提供了用于管理容器、Pod、容器镜像和卷的 API。 Podman 每年发布 4 次主要或次要版本,时间分别在 2 月、5 月、8 月和 11 月的第二周。补丁发布更为频繁,可能随时进行以向用户提供错误修复。所有版本均经过 PGP 签名。获准进行发布的团队成员的公钥位于[此处](https://github.com/containers/release-keys/tree/main/podman)。 * 持续集成: * [](https://cirrus-ci.com/github/containers/podman/main) * [GoDoc: ](https://godoc.org/github.com/containers/podman/libpod) * [下载](DOWNLOADS.md) ## 概述与范围 从宏观角度来看,Podman 和 libdoc 的范围如下: * 支持多种容器镜像格式,包括 OCI 和 Docker 镜像。 * 对这些镜像的全面管理,包括从各种来源拉取(包括信任和验证)、创建(通过 Containerfile 或 Dockerfile 构建或从容器提交)以及推送到注册表和其他存储后端。 * 容器生命周期的全面管理,包括创建(从镜像和从解压的根文件系统)、运行、检查点和恢复(通过 CRIU)以及移除。 * 使用 Netavark 进行容器网络的全面管理。 * 支持 Pod,即共享资源并一起管理的容器组。 * 支持在无 root 或其他提升权限的情况下运行容器和 Pod。 * 容器和 Pod 的资源隔离。 * 支持兼容 Docker 的 CLI 接口,既可以在本地也可以在远程系统上运行容器。 * 无管理守护进程,提高了安全性并降低了空闲时的资源利用率。 * 支持 REST API,提供兼容 Docker 的接口和展示高级 Podman 功能的改进接口。 * 支持通过 `podman machine` 运行的虚拟机在 Windows 和 Mac 上运行。 ## 路线图 Podman 功能开发的未来规划可在其**[路线图](ROADMAP.md)**中找到。 ## 沟通交流 如果您认为在项目中发现了安全问题,请*不要*通过 GitHub issue 跟踪器、邮件列表或 IRC 公开报告该问题。 相反,请发送一封包含尽可能多详细信息的电子邮件至 `security@lists.podman.io`。这是一个供核心维护者使用的私人邮件列表。 对于一般性问题和讨论,请使用 Podman 的 [渠道](https://podman.io/community/#slack-irc-matrix-and-discord)。 有关问题/错误和功能的讨论,您可以使用 GitHub [issues](https://github.com/containers/podman/issues) 和 [PRs](https://github.com/containers/podman/pulls) 跟踪系统。 此外还有一个位于 `lists.podman.io` 的[邮件列表](https://lists.podman.io/archives/)。 您可以通过向 `podman-join@lists.podman.io` 发送主题为 `subscribe` 的消息来订阅。 ## Rootless(无根模式) Podman 可以轻松地以普通用户身份运行,无需 setuid 二进制文件。 当在没有 root 的情况下运行时,Podman 容器使用用户命名空间将容器中的 root 设置为运行 Podman 的用户。 Rootless Podman 运行受限的容器,这些容器不具备运行容器的用户所没有的权限。 其中一些限制可以被解除(例如通过 `--privileged`),但 rootless 容器永远不会拥有比启动它们的用户更多的权限。 如果您以自己的用户身份运行 Podman 并从主机挂载 `/etc/passwd`,您仍然无法更改它,因为您的用户没有这样做的权限。 几乎所有正常的 Podman 功能都可用,尽管存在一些[不足之处](https://github.com/containers/podman/blob/main/rootless.md)。 任何最新的 Podman 版本都应该能够在无需额外配置的情况下运行 rootless,尽管您的操作系统可能需要一些额外的配置,详见[安装指南](https://podman.io/getting-started/installation)。 在使用 rootless Podman 之前,管理员需要进行少量配置,必要的设置记录在[此处](https://github.com/containers/podman/blob/main/docs/tutorials/rootless_tutorial.md)。 ## Podman Desktop [Podman Desktop](https://podman-desktop.io/) 为 Linux、Windows 和 Mac 机器上的 Podman 和 Kubernetes 提供了本地开发环境。 它是 Podman 的全功能桌面 UI 前端,在非 Linux 操作系统上使用 `podman machine` 后端来运行容器。 它支持完整的容器生命周期管理(构建、拉取和推送镜像,创建和管理容器,创建和管理 Pod,以及处理 Kubernetes YAML)。 该项目在 [GitHub](https://github.com/containers/podman-desktop) 上开发,欢迎贡献。 ## 超出范围 * 专门的签名并将镜像推送到各种存储后端。 有关这些任务,请参阅 [Skopeo](https://github.com/containers/skopeo/)。 * 支持 Kubernetes CRI 接口进行容器管理。 [CRI-O](https://github.com/cri-o/cri-o) 守护进程专攻于此。 ## OCI 项目计划 Podman 在不同方面使用 OCI 项目和同类最佳的库: - Runtime:我们使用 [OCI runtime tools](https://github.com/opencontainers/runtime-tools) 生成 OCI runtime 配置,这些配置可与任何兼容 OCI 的 runtime 一起使用,例如 [crun](https://github.com/containers/crun/) 和 [runc](https://github.com/opencontainers/runc/)。 - 镜像:镜像管理使用 [containers/image](https://github.com/containers/image) 库。 - 存储:容器和镜像存储由 [containers/storage](https://github.com/containers/storage) 管理。 - 网络:通过网络使用 [Netavark](https://github.com/containers/netavark) 和 [Aardvark](https://github.com/containers/aardvark-dns) 提供支持。Rootless 网络通过 [pasta](https://passt.top/passt) 或 [slirp4netns](https://github.com/rootless-containers/slirp4netns) 处理。 - 构建:通过 [Buildah](https://github.com/containers/buildah) 支持构建。 - Conmon:[Conmon](https://github.com/containers/conmon) 是一个用于监控 OCI runtime 的工具,被 Podman 和 CRI-O 共同使用。 - Seccomp:Podman、Buildah 和 CRI-O 的统一 [Seccomp](https://github.com/containers/container-libs/blob/main/common/pkg/seccomp/seccomp.json) 策略。 ## 面向开发者的 Podman 信息 有关博客、发布公告等内容,请查看 [podman.io](https://podman.io) 网站! **[安装说明](install.md)** 有关如何在您的环境中安装 Podman 的信息。 **[OCI Hooks 支持](https://github.com/containers/container-libs/blob/main/common/pkg/hooks/README.md)** 有关 Podman 如何配置 [OCI Hooks][spec-hooks] 以在启动容器时运行的信息。 **[Podman API](https://docs.podman.io/en/latest/_static/api.html)** Podman REST API 文档。 **[Podman 命令](https://podman.readthedocs.io/en/latest/Commands.html)** Podman 命令列表,包含指向其 man pages 的链接,在许多情况下还有展示命令使用的视频。 **[Podman 容器镜像](https://github.com/containers/image_build/blob/main/podman/README.md)** 有关 [quay.io](https://quay.io/podman/stable) 上的 Podman 容器镜像的信息。 **[Podman 故障排除指南](troubleshooting.md)** Podman 常见问题和解决方案列表。 **[Podman 使用迁移](transfer.md)** 与使用 Podman 的基础设施相关的运维和开发迁移有用信息。此页面包含显示 Docker 命令及其 Podman 等效命令的表格。 **[教程](docs/tutorials)** 使用 Podman 的教程。 **[远程客户端](https://github.com/containers/podman/blob/main/docs/tutorials/remote_client.md)** 关于使用 Podman 远程客户端的简要指南。 **[Rootless 环境下 Podman 的基本设置和使用](https://github.com/containers/podman/blob/main/docs/tutorials/rootless_tutorial.md)** 展示运行 Rootless Podman 所需的设置和配置的教程。 **[发布说明](RELEASE_NOTES.md)** 近期 Podman 版本的发布说明。 **[贡献](CONTRIBUTING.md)** 有关为此项目做贡献的信息。 ## Buildah 和 Podman 的关系 Buildah 和 Podman 是两个互补的开源项目, 可在大多数 Linux 平台上使用,这两个项目都位于 [GitHub.com](https://github.com),Buildah 在[此处](https://github.com/containers/buildah),Podman 在 [此处](https://github.com/containers/podman)。Buildah 和 Podman 都是 在 Open Container Initiative (OCI) 镜像和容器上工作的命令行工具。 这两个项目在专业化方面有所不同。 Buildah 专攻构建 OCI 镜像。Buildah 的命令复制了 Dockerfile 中的所有命令。这允许在不需要任何 root 权限的情况下 使用和不使用 Dockerfile 构建镜像。 Buildah 的最终目标是提供一个底层的 coreutils 接口来 构建镜像。在没有 Dockerfile 的情况下构建镜像的灵活性允许 将其他脚本语言集成到构建过程中。 Buildah 遵循简单的 fork-exec 模型,不作为守护进程运行, 但它基于 golang 中的综合 API,可以被 vendored 到其他工具中。 Podman 专攻所有帮助您维护和修改 OCI 镜像的命令和功能, 例如拉取和标记。它还允许您创建、运行和维护从这些镜像创建的容器。 为了通过 Dockerfile 构建容器镜像,Podman 使用 Buildah 的 golang API,并且可以独立于 Buildah 安装。 Podman 和 Buildah 之间的一个主要区别是它们对容器的概念。Podman 允许用户创建“传统容器”,这些容器的意图是 长期存在的。而 Buildah 容器实际上只是为了允许将内容 添加回容器镜像而创建的。一个简单的思考方式是, `buildah run` 命令模拟 Dockerfile 中的 RUN 命令,而 `podman run` 命令在功能上模拟 `docker run` 命令。因此以及它们底层的 存储差异,您无法在 Buildah 中看到 Podman 容器,反之亦然。 简而言之,Buildah 是创建 OCI 镜像的有效方式,而 Podman 允许 您在生产环境中使用熟悉的容器 cli 命令管理和维护这些镜像和容器。 欲知更多详情,请参阅 [Container Tools Guide](https://github.com/containers/buildah/tree/main/docs/containertools)。 ## Podman Hello ``` $ podman run quay.io/podman/hello Trying to pull quay.io/podman/hello:latest... Getting image source signatures Copying blob a6b3126f3807 done Copying config 25c667d086 done Writing manifest to image destination Storing signatures !... Hello Podman World ...! .--"--. / - - \ / (O) (O) \ ~~~| -=(,Y,)=- | .---. /` \ |~~ ~/ o o \~~~~.----. ~~ | =(X)= |~ / (O (O) \ ~~~~~~~ ~| =(Y_)=- | ~~~~ ~~~| U |~~ Project: https://github.com/containers/podman Website: https://podman.io Documents: https://docs.podman.io Twitter: @Podman_io ```
标签:Cgroups, DevOps工具, DNS解析, Docker替代, Go语言, Libpod, Linux容器, Namespace, OCI容器, Podman, Pods, Rootless容器, 后端开发, 基础设施, 容器管理, 容器编排, 开源项目, 无守护进程, 日志审计, 程序破解, 虚拟化, 镜像管理