podman v5.6.0 版本更新介绍
发布日期: 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 create和podman run的--mount选项现在支持dest=作为destination=的有效别名。podman kube play命令现在可以使用io.podman.annotations.cpuset/$ctrname和io.podman.annotations.memory-nodes/$ctrname注解将容器执行限制在特定的 CPU 核心和特定的内存节点上(#26172)。podman kube play命令现在支持 Pod YAML 中的lifecycle.stopSignal字段,允许指定用于停止容器的信号(#25389)。- 用于与 OCI 工件交互的
podman artifact命令套件现在在远程 Podman 客户端和 REST API 绑定中可用。 podman volume import和podman 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 create、podman run和podman pod create的--mount type=artifact选项现在允许使用name=选项设置工件在容器中的文件名(例如podman run --mount type=artifact,name=$NAME,...)。podman create和podman 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 run和podman attach的--sig-proxy选项执行的信号转发现在对竞争条件更加健壮,并且不再转发SIGSTOP信号。podman system check --quick命令现在跳过检查层摘要。- 在 Windows 上使用 WSLv2 提供程序的 Podman 现在优先使用
C:\\Program Files\\Windows Subsystem for Linux\\wsl.exe中的 WSL 可执行文件,而不是WindowsApps中的文件,从而避免常见的“拒绝访问”问题(#25787)。 podman create、podman run和podman pod create的--mount type=artifact选项现在会将仅包含单个 blob 的工件作为文件挂载到给定的目标路径,前提是该路径在镜像中不存在。podman volume export命令现在拒绝在标准输出 (STDOUT) 为 TTY 时进行导出(#26506)。- 生成带有已知在与 Podman 一起使用时存在问题的选项的 Quadlet 单元时(例如单元
[Service]部分中的User=、Group=和DynamicUser=),Quadlet 现在会向用户发出潜在不兼容性的警告(#26543)。
错误修复
- 修复了
podman create和podman 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 create和podman run的--mount选项在未指定时要求必须指定type=选项,而不是默认为volume的错误(#26101)。 - 修复了在 Windows 上为 YAML 文件指定绝对路径时,
podman kube play命令会失败的错误(#26350)。 - 修复了
podman create、podman run和podman pod create的--security-opt seccomp=选项在 Windows 上接收 Seccomp 配置文件路径时可能出错的错误(#26558)。 - 修复了
podman create和podman 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), andpodman 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
.containerunits can now specify environment variables without values in theEnvironment=key, retrieving the value from the host when the container is started (#26247). - Quadlet
.podunits now support two new keys,Label=(to set labels on the created pod) andExitPolicy=(to set exit policy for the created pod) (#25961 and #25596). - Quadlet
.imageunits 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
.networkunits now support a new key,InterfaceName=, to specify the name of the network interface created. - The
podman machine initcommand now supports a new option,--swap, enabling swap in the created virtual machine and setting it to a given size (in megabytes) (#15980). - The
--mountoption topodman createandpodman runnow supportsdest=as a valid alias fordestination=. - The
podman kube playcommand can now restrict container execution to specific CPU cores and specific memory nodes using theio.podman.annotations.cpuset/$ctrnameandio.podman.annotations.memory-nodes/$ctrnameannotations (#26172). - The
podman kube playcommand now supports thelifecycle.stopSignalfield in Pod YAML, allowing the signal used to stop containers to be specified (#25389). - The
podman artifactsuite 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 importandpodman volume exportcommands are now available in the remote Podman client (#26049). - The
--build-contextoption topodman buildis now supported by the remote Podman client (#23433). - The
podman volume createcommand now accepts two new options,--uidand--gid, to set the UID and GID the volume will be created with. - The
podman secret createcommand now has a new option,--ignore, causing the command to succeed even if a secret with the given name already exists. - The
podman pullcommand now has a new option,--policy, to configure pull policy. - The
--mount type=artifactoption topodman create,podman run, andpodman pod createnow allows the filename of the artifact in the container to be set using thename=option (e.g.podman run --mount type=artifact,name=$NAME,...). - The
--tmpfsoption topodman createandpodman runnow allows a new option,noatime, to be passed (e.g.podman run --tmpfs /run:noatime ...) (#26102). - The
podman updatecommand 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 machineVMs 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 artifactsuite of commands for interacting with OCI artifacts is now considered stable. - For users running
podman machineVMs using thelibkrunprovider on an M3 or newer host running macOS 15+, nested virtualization is enabled by default. - When creating
podman machineVMs on Windows using the WSL v2 provider, images are now pulled as artifacts fromquay.io/podman/machine-os, matching the behavior of other VM providers. - Signal forwarding done by the
--sig-proxyoption topodman runandpodman attachis now more robust to races and no longer forwards theSIGSTOPsignal. - The
podman system check --quickcommand 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.exeover the one inWindowsApps, avoiding common “access denied” issues (#25787). - The
--mount type=artifactoption topodman create,podman run, andpodman pod createnow 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 exportcommand now refuses to export toSTDOUTif it is a TTY (#26506). - When generating Quadlet units with options known to be problematic when used with Podman, such as
User=,Group=, andDynamicUser=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 topodman createandpodman rundid 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 initcould fail if run in a Podman container (#25950). - Fixed a bug where
podman machineVMs would sometimes receive incorrect timezone information. - Fixed a bug where
podman machineVMs created with a custom username would not have lingering enabled. - Fixed a bug where the
podman machine initcommand 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
.podunits that did not specify thePodName=key was set incorrectly (#26062). - Fixed a bug where Quadlet
.containerunits joining a pod specified in a.podunit would fail as the pod name was set incorrectly when creating the container (#26105). - Fixed a bug where Quadlet would not generate
RequiresMountsForwhen mounting a.volumeunit withType=bindset 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
.podfiles did not include the lastEnvironment=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-dirwould fail to run when containers were restarted (#17935). - Fixed a bug where the
--mountoption topodman createandpodman runrequired thetype=option to be specified, instead of defaulting tovolumewhen it was not present (#26101). - Fixed a bug where the
podman kube playcommand would fail on Windows when specifying an absolute path to YAML files (#26350). - Fixed a bug where the
--security-opt seccomp=option topodman create,podman run, andpodman pod createcould 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-iopsoptions topodman createandpodman runincorrectly accepted non-block devices. - Fixed a bug where the
podman buildcommand handled the--ignorefileoption differently from thebuildah budcommand (#25746). - Fixed a bug where the
podman rm -fcommand could return an error when trying to remove a running container whoseconmonprocess had been killed (#26640). - Fixed a bug where the
podman inspectcommand did not correctly display log size for containers whenlog_size_maxwas 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_fileoption incontainers.conf. - The Compat System Info endpoint now returns a new field,
DefaultAddressPools. - The Compat System DF endpoint has removed the deprecated
BuilderSizefield. - The Compat Ping endpoint now sets
Builder-Versionto1to match Docker installs that do not include BuildKit. - The Compat List endpoint for Images now returns the
shared-sizefield unconditionally, even if theshared-sizequery 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
VirtualSizefield 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
FORCEparameter 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/jsonresponses would be HTML escaped, mutating some responses (e.g.<missing>becoming\u003cmissing\u003ein 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
libsqlite3build 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
下载链接
- podman-5.6.0-setup.exe
- podman-installer-macos-amd64.pkg
- podman-installer-macos-arm64.pkg
- podman-installer-macos-universal.pkg
- podman-installer-windows-amd64.exe
- podman-installer-windows-arm64.exe
- podman-remote-release-darwin_amd64.zip
- podman-remote-release-darwin_arm64.zip
- podman-remote-release-windows_amd64.zip
- podman-remote-release-windows_arm64.zip
- podman-remote-static-linux_amd64.tar.gz
- podman-remote-static-linux_arm64.tar.gz
- shasums