发布日期: 2025-08-15
版本号: v5.6.0

Podman 5.6 引入了管理 Quadlet 的新命令(如安装、列表、打印和移除),并为各类 Quadlet 单元增加了环境变量、标签、拉取策略等配置选项。同时,podman machine init 支持了交换空间设置,多个命令扩展了挂载、CPU/内存绑定等能力,部分客户端功能(如 Artifact 命令)也已支持远程操作。此版本因内核问题默认禁用了 Rosetta 支持,并为最终移除 BoltDB 数据库做了准备。修复了包括容器停止误杀进程、安全选项解析错误、跨平台兼容性等大量缺陷,API 端点新增了对 Artifact 的完整交互支持,同时优化了构建流程并更新了依赖库。

更新内容 (中文)

功能特性

  • 新增了一套用于管理 Quadlet 的命令:podman quadlet install(为当前用户安装新的 Quadlet)、podman quadlet list(列出已安装的 Quadlet)、podman quadlet print(打印 Quadlet 文件内容)和 podman quadlet rm(删除 Quadlet)。目前这些命令尚未提供远程 Podman 客户端支持——我们预计将在未来版本中添加支持。
  • Quadlet .container 单元现在允许在 Environment= 键中指定不带值的环境变量,并在容器启动时从宿主机获取该值(#26247)。
  • Quadlet .pod 单元现在支持两个新键:Label=(用于为创建的 Pod 设置标签)和 ExitPolicy=(用于设置创建的 Pod 的退出策略)(#25961#25596)。
  • Quadlet .image 单元现在支持一个新键 Policy=,用于设置镜像的拉取策略(例如始终拉取,仅在有更新版本时拉取)(#26446)。
  • Quadlet .network 单元现在支持一个新键 InterfaceName=,用于指定创建的网络接口的名称。
  • podman machine init 命令现在支持一个新选项 --swap,可在创建的虚拟机中启用交换空间并将其设置为指定大小(以兆字节为单位)(#15980)。
  • podman createpodman run--mount 选项现在支持 dest= 作为 destination= 的有效别名。
  • podman kube play 命令现在可以使用 io.podman.annotations.cpuset/$ctrnameio.podman.annotations.memory-nodes/$ctrname 注解将容器执行限制在特定的 CPU 核心和特定的内存节点上(#26172)。
  • podman kube play 命令现在支持 Pod YAML 中的 lifecycle.stopSignal 字段,允许指定用于停止容器的信号(#25389)。
  • 用于与 OCI 工件交互的 podman artifact 命令套件现在在远程 Podman 客户端和 REST API 绑定中可用。
  • podman volume importpodman volume export 命令现在在远程 Podman 客户端中可用(#26049)。
  • podman build--build-context 选项现在在远程 Podman 客户端中受支持(#23433)。
  • podman volume create 命令现在接受两个新选项 --uid--gid,用于设置创建卷时使用的 UID 和 GID。
  • podman secret create 命令现在有一个新选项 --ignore,即使给定名称的密钥已存在,该命令也会成功执行。
  • podman pull 命令现在有一个新选项 --policy,用于配置拉取策略。
  • podman createpodman runpodman pod create--mount type=artifact 选项现在允许使用 name= 选项设置工件在容器中的文件名(例如 podman run --mount type=artifact,name=$NAME,...)。
  • podman createpodman run--tmpfs 选项现在允许传递一个新选项 noatime(例如 podman run --tmpfs /run:noatime ...)(#26102)。
  • podman update 命令现在有一个新选项 --latest,用于更新最新的容器而非指定特定容器(#26380)。
  • 新增了命令 podman buildx inspect 以改善与 Docker 的兼容性(#13014)。

破坏性变更

  • 由于较新 Linux 内核的问题,podman machine 虚拟机中的 Rosetta 支持现已默认禁用。这些问题已在 Tahoe 测试版中解决,我们计划在未来 Podman 版本中重新启用 Rosetta 支持,前提是该修复已广泛发布。您可以在此处找到更多详情:此处

变更

  • 为计划在 Podman 6.0 中移除 BoltDB 数据库做准备,已为仍在使用 BoltDB 的安装添加了警告。目前这些警告默认不可见,将在 Podman 5.7 中显示。
  • 用于与 OCI 工件交互的 podman artifact 命令套件现在被视为稳定功能。
  • 对于在 M3 或更新的主机(运行 macOS 15+)上使用 libkrun 提供程序运行 podman machine 虚拟机的用户,现在默认启用嵌套虚拟化。
  • 在使用 WSL v2 提供程序在 Windows 上创建 podman machine 虚拟机时,现在从 quay.io/podman/machine-os 以工件形式拉取镜像,与其他虚拟机提供程序的行为保持一致。
  • podman runpodman attach--sig-proxy 选项执行的信号转发现在对竞争条件更加健壮,并且不再转发 SIGSTOP 信号。
  • podman system check --quick 命令现在跳过检查层摘要。
  • 在 Windows 上使用 WSLv2 提供程序的 Podman 现在优先使用 C:\\Program Files\\Windows Subsystem for Linux\\wsl.exe 中的 WSL 可执行文件,而不是 WindowsApps 中的文件,从而避免常见的“拒绝访问”问题(#25787)。
  • podman createpodman runpodman pod create--mount type=artifact 选项现在会将仅包含单个 blob 的工件作为文件挂载到给定的目标路径,前提是该路径在镜像中不存在。
  • podman volume export 命令现在拒绝在标准输出 (STDOUT) 为 TTY 时进行导出(#26506)。
  • 生成带有已知在与 Podman 一起使用时存在问题的选项的 Quadlet 单元时(例如单元 [Service] 部分中的 User=Group=DynamicUser=),Quadlet 现在会向用户发出潜在不兼容性的警告(#26543)。

错误修复

  • 修复了 podman createpodman run--security-opt unmask= 选项不允许传递逗号分隔的路径列表,而仅允许单个路径的错误。
  • 修复了停止 Podman 容器时,如果容器内启动的 exec 会话的 PID 在容器运行期间被新进程重用,可能会意外杀死非 Podman 进程的错误(#25104)。
  • 修复了如果在 Podman 容器内运行,podman machine init 可能会失败的错误(#25950)。
  • 修复了 podman machine 虚拟机有时会收到不正确时区信息的错误。
  • 修复了使用自定义用户名创建的 podman machine 虚拟机未启用持久化的错误。
  • 修复了在 Windows 上使用 WSL 2 提供程序时,podman machine init 命令无法可靠地确定 WSL 是否已安装的错误(#25523)。
  • 修复了未指定 PodName= 键的 Quadlet .pod 单元的名称设置不正确的错误(#26062)。
  • 修复了加入 .pod 单元中指定的 Pod 的 Quadlet .container 单元在创建容器时因 Pod 名称设置不正确而失败的错误(#26105)。
  • 修复了当挂载设置了 Type=bind.volume 单元到容器时,Quadlet 不会生成 RequiresMountsFor 的错误(#26125)。
  • 修复了如果两个 dropin 文件没有共享父目录,新 dropin 文件未能正确覆盖具有相同名称的后续层次结构中的旧 dropin 文件的错误(#26555)。
  • 修复了 Quadlet 有时在解析单元失败时不打印警告的错误(#26542)。
  • 修复了 Quadlet .pod 文件在生成的 systemd 服务中未包含 [Service] 部分中最后一个 Environment= 键的错误(#26521)。
  • 修复了启动具有已运行依赖项的容器时会失败的错误。
  • 修复了当容器重启时,使用 --hooks-dir 指定的目录中的 OCI 钩子无法运行的错误(#17935)。
  • 修复了 podman createpodman run--mount 选项在未指定时要求必须指定 type= 选项,而不是默认为 volume 的错误(#26101)。
  • 修复了在 Windows 上为 YAML 文件指定绝对路径时,podman kube play 命令会失败的错误(#26350)。
  • 修复了 podman createpodman runpodman pod create--security-opt seccomp= 选项在 Windows 上接收 Seccomp 配置文件路径时可能出错的错误(#26558)。
  • 修复了 podman createpodman run--blkio-weight-device--device-read-bps--device-write-bps--device-read-iops--device-write-iops 选项错误地接受非块设备的错误。
  • 修复了 podman build 命令处理 --ignorefile 选项的方式与 buildah bud 命令不同的错误(#25746)。
  • 修复了在尝试删除 conmon 进程已被终止的运行容器时,podman rm -f 命令可能返回错误的错误(#26640)。
  • 修复了当在 containers.conf 中设置了 log_size_max 时,podman inspect 命令未正确显示容器日志大小的错误。

API

  • 添加了一组完整的用于与工件交互的 API 端点,包括检查工件 (GET /libpod/artifacts/{name}/json)、列出所有工件 (GET /libpod/artifacts/json)、拉取工件 (POST /libpod/artifacts/pull)、删除工件 (DELETE /libpod/artifacts/{name})、从请求体中的 tar 文件添加工件(或追加到现有工件)(POST /libpod/artifacts/add)、将工件推送到注册表 (/libpod/artifacts/{name}/push) 以及检索工件内容 (GET /libpod/artifacts/{name}/extract)。
  • 容器的兼容性创建端点现在接受一个新参数 HostConfig.CgroupnsMode,用于指定创建容器的 cgroup 命名空间模式。
  • 容器的兼容性创建端点现在尊重 containers.conf 中的 base_hosts_file 选项。
  • 兼容性系统信息端点现在返回一个新字段 DefaultAddressPools
  • 兼容性系统 DF 端点已移除已弃用的 BuilderSize 字段。
  • 兼容性 Ping 端点现在将 Builder-Version 设置为 1,以匹配不包含 BuildKit 的 Docker 安装。
  • 镜像的兼容性列表端点现在无条件返回 shared-size 字段,即使未将 shared-size 查询参数设置为 true。如果未通过查询参数请求,则将其设置为 -1。这改善了 Docker API 兼容性。
  • 镜像的兼容性检查端点现在当请求 Docker API 版本 1.44 及更高版本时,不再返回已弃用的 VirtualSize 字段。
  • 修复了当 FORCE 参数设置为 true 时,容器的兼容性删除 API 会删除运行容器的错误;Docker 仅删除已停止的容器(#25871)。
  • 修复了容器的兼容性列表和兼容性检查端点使用 Podman 状态而非转换为 Docker 兼容状态返回容器状态的错误(#17728)。
  • 修复了超时的健康检查未被正确终止的错误;如果其超时,它们现在会收到 SIGTERM,然后在延迟后收到 SIGKILL(#26086)。
  • 修复了 application/json 响应被 HTML 转义,从而改变某些响应(例如在镜像历史记录响应中 <missing> 变为 \\u003cmissing\\u003e)的错误(#17769)。

其他

  • Quadlet 在停止容器时不再使用容器/Pod ID 文件,而是直接将容器/Pod 的名称传递给 podman stop/podman pod stop
  • 通过 Makefile 构建 Podman 时,如果本地安装了 sqlite3 库和头文件,现在将尝试动态链接 sqlite3。此项及其他优化应导致相对于 Podman 5.5.x,二进制文件大小显著减小。打包者可以在不使用 Makefile 构建时使用 libsqlite3 构建标签来强制执行此行为。
  • 将 Buildah 更新到 v1.41.3
  • 将 containers/common 库更新到 v0.64.1
  • 将 containers/storage 库更新到 v1.59.1
  • 将 containers/image 库更新到 v5.36.1

更新内容 (原始)

Features

  • A new set of commands for managing Quadlets has been added as podman quadlet install (install a new Quadlet for the current user), podman quadlet list (list installed Quadlets), podman quadlet print (print the contents of a Quadlet file), and podman quadlet rm (remove a Quadlet). These commands are presently not available with the remote Podman client - we expect support for this to arrive in a future release.
  • Quadlet .container units can now specify environment variables without values in the Environment= key, retrieving the value from the host when the container is started (#26247).
  • Quadlet .pod units now support two new keys, Label= (to set labels on the created pod) and ExitPolicy= (to set exit policy for the created pod) (#25961 and #25596).
  • Quadlet .image units now support a new key, Policy=, to set pull policy for the image (e.g. pull always, pull only if newer version available) (#26446).
  • Quadlet .network units now support a new key, InterfaceName=, to specify the name of the network interface created.
  • The podman machine init command now supports a new option, --swap, enabling swap in the created virtual machine and setting it to a given size (in megabytes) (#15980).
  • The --mount option to podman create and podman run now supports dest= as a valid alias for destination=.
  • The podman kube play command can now restrict container execution to specific CPU cores and specific memory nodes using the io.podman.annotations.cpuset/$ctrname and io.podman.annotations.memory-nodes/$ctrname annotations (#26172).
  • The podman kube play command now supports the lifecycle.stopSignal field in Pod YAML, allowing the signal used to stop containers to be specified (#25389).
  • The podman artifact suite of commands for interacting with OCI artifacts is now available in the remote Podman client and the bindings for the REST API.
  • The podman volume import and podman volume export commands are now available in the remote Podman client (#26049).
  • The --build-context option to podman build is now supported by the remote Podman client (#23433).
  • The podman volume create command now accepts two new options, --uid and --gid, to set the UID and GID the volume will be created with.
  • The podman secret create command now has a new option, --ignore, causing the command to succeed even if a secret with the given name already exists.
  • The podman pull command now has a new option, --policy, to configure pull policy.
  • The --mount type=artifact option to podman create, podman run, and podman pod create now allows the filename of the artifact in the container to be set using the name= option (e.g. podman run --mount type=artifact,name=$NAME,...).
  • The --tmpfs option to podman create and podman run now allows a new option, noatime, to be passed (e.g. podman run --tmpfs /run:noatime ...) (#26102).
  • The podman update command now has a new option, --latest, to update the latest container instead of specifying a specific container (#26380).
  • A new command, podman buildx inspect, has been added to improve Docker compatibility (#13014).

Breaking Changes

  • Rosetta support in podman machine VMs has been disabled by default due to issues with newer Linux kernels. These issues have been addressed in the Tahoe beta, and we plan on re-enabling support for Rosetta in a future Podman release once the fix is in wider circulation. You can find more details here.

Changes

  • In preparation for a planned removal of the BoltDB database in Podman 6.0, a warning has been added for installations still using BoltDB. These warnings are presently not visible by default, which will happen in Podman 5.7.
  • The podman artifact suite of commands for interacting with OCI artifacts is now considered stable.
  • For users running podman machine VMs using the libkrun provider on an M3 or newer host running macOS 15+, nested virtualization is enabled by default.
  • When creating podman machine VMs on Windows using the WSL v2 provider, images are now pulled as artifacts from quay.io/podman/machine-os, matching the behavior of other VM providers.
  • Signal forwarding done by the --sig-proxy option to podman run and podman attach is now more robust to races and no longer forwards the SIGSTOP signal.
  • The podman system check --quick command now skips checking layer digests.
  • Podman on Windows using the WSLv2 provider now prefers the WSL executable in C:\Program Files\Windows Subsystem for Linux\wsl.exe over the one in WindowsApps, avoiding common “access denied” issues (#25787).
  • The --mount type=artifact option to podman create, podman run, and podman pod create now mounts artifacts containing a only a single blob as a file at the given destination path if the path does not exist in the image.
  • The podman volume export command now refuses to export to STDOUT if it is a TTY (#26506).
  • When generating Quadlet units with options known to be problematic when used with Podman, such as User=, Group=, and DynamicUser= in the [Service] section of a unit, Quadlet will now warn the user of the potential incompatibility (#26543).

Bugfixes

  • Fixed a bug where the --security-opt unmask= option to podman create and podman run did not allow comma-separated lists of paths to be passed, instead only allowing a single path.
  • Fixed a bug where stopping a Podman container could unintentionally kill non-Podman processes if the PID of an exec session started inside the container was reused for a new process while the container was running (#25104).
  • Fixed a bug where podman machine init could fail if run in a Podman container (#25950).
  • Fixed a bug where podman machine VMs would sometimes receive incorrect timezone information.
  • Fixed a bug where podman machine VMs created with a custom username would not have lingering enabled.
  • Fixed a bug where the podman machine init command on Windows when using the WSL 2 provider did not reliably determine if WSL was installed (#25523).
  • Fixed a bug where the name of Quadlet .pod units that did not specify the PodName= key was set incorrectly (#26062).
  • Fixed a bug where Quadlet .container units joining a pod specified in a .pod unit would fail as the pod name was set incorrectly when creating the container (#26105).
  • Fixed a bug where Quadlet would not generate RequiresMountsFor when mounting a .volume unit with Type=bind set into a container (#26125).
  • Fixed a bug where Quadlet dropin files were not correctly overwritten by new dropin files with the same name further along the hierarchy if the two dropin files did not share a parent directory (#26555).
  • Fixed a bug where Quadlet would sometimes not print warnings when failing to parse units (#26542).
  • Fixed a bug where Quadlet .pod files did not include the last Environment= key in the [Service] section in the generated systemd service (#26521).
  • Fixed a bug where starting a container with already-running dependencies would fail.
  • Fixed a bug where OCI hooks in a directory specified with --hooks-dir would fail to run when containers were restarted (#17935).
  • Fixed a bug where the --mount option to podman create and podman run required the type= option to be specified, instead of defaulting to volume when it was not present (#26101).
  • Fixed a bug where the podman kube play command would fail on Windows when specifying an absolute path to YAML files (#26350).
  • Fixed a bug where the --security-opt seccomp= option to podman create, podman run, and podman pod create could error on Windows when given a path to a Seccomp profile (#26558).
  • Fixed a bug where the --blkio-weight-device, --device-read-bps, --device-write-bps, --device-read-iops, and --device-write-iops options to podman create and podman run incorrectly accepted non-block devices.
  • Fixed a bug where the podman build command handled the --ignorefile option differently from the buildah bud command (#25746).
  • Fixed a bug where the podman rm -f command could return an error when trying to remove a running container whose conmon process had been killed (#26640).
  • Fixed a bug where the podman inspect command did not correctly display log size for containers when log_size_max was set in containers.conf.

API

  • A full set of API endpoints for interacting with artifacts has been added, including inspecting artifacts (GET /libpod/artifacts/{name}/json), listing all artifacts (GET /libpod/artifacts/json), pulling an artifact (POST /libpod/artifacts/pull), removing an artifact (DELETE /libpod/artifacts/{name}), adding an artifact (or appending to an existing artifact) from a tar file in the request body (POST /libpod/artifacts/add), pushing an artifact to a registry (/libpod/artifacts/{name}/push), and retrieving the contents of an artifact (GET /libpod/artifacts/{name}/extract).
  • The Compat Create endpoint for Containers now accepts a new parameter, HostConfig.CgroupnsMode, to specify the cgroup namespace mode of the created container.
  • The Compat Create endpoint for Containers now respects the base_hosts_file option in containers.conf.
  • The Compat System Info endpoint now returns a new field, DefaultAddressPools.
  • The Compat System DF endpoint has removed the deprecated BuilderSize field.
  • The Compat Ping endpoint now sets Builder-Version to 1 to match Docker installs that do not include BuildKit.
  • The Compat List endpoint for Images now returns the shared-size field unconditionally, even if the shared-size query parameter was not set to true. If not requested through query parameter, it is set to -1. This improves Docker API compatibility.
  • The Compat Inspect endpoint for Images now no longer returns the deprecated VirtualSize field when Docker API version 1.44 and up is requested.
  • Fixed a bug where the Compat Delete API for Containers would remove running containers when the FORCE parameter was set to true; Docker only removes stopped containers (#25871).
  • Fixed a bug where the Compat List and Compat Inspect endpoints for Containers returned container status using Podman statuses instead of converting to Docker-compatible statuses (#17728).
  • Fixed a bug where healthchecks that exceeded their timeout were not properly terminated; they now receive SIGTERM, then SIGKILL after a delay, if their timeout is exceeded (#26086).
  • Fixed a bug where application/json responses would be HTML escaped, mutating some responses (e.g. <missing> becoming \u003cmissing\u003e in image history responses) (#17769).

Misc

  • Quadlet now no longer uses container/pod ID files when stopping containers, but instead passes the name of the container/pod directly to podman stop/podman pod stop.
  • When building Podman via Makefile, it will now attempt to dynamically link sqlite3 if the library and header are installed locally. This and other optimizations should result in a significant reduction in binary size relative to Podman 5.5.x. Packagers can use the libsqlite3 build tag to force this behavior when not using the Makefile to build.
  • Updated Buildah to v1.41.3
  • Updated the containers/common library to v0.64.1
  • Updated the containers/storage library to v1.59.1
  • Updated the containers/image library to v5.36.1

下载链接