podman v5.6.0-rc2 版本更新介绍
发布日期: 2025-08-08
版本号: v5.6.0-rc2
Podman 的本次更新引入了一系列新功能、改动和修复。新功能方面,新增了
podman quadlet install、list、rm命令用于管理 Quadlet,但当前暂不支持远程客户端。Quadlet 本身得到扩展,.container单元支持在Environment=键中指定无值环境变量,启动时从主机获取值;.pod单元支持Label=和ExitPolicy=键;.image单元支持Policy=键;.network单元支持InterfaceName=键。podman machine init命令新增--swap选项。--mount选项现在支持dest=作为destination=的别名。podman kube play命令可通过注解将容器执行限制在特定 CPU 核心和内存节点,并支持 Pod YAML 中的lifecycle.stopSignal字段。用于与 OCI 制品交互的podman artifact命令套件现已在远程客户端和 REST API 绑定中可用。podman volume import和podman volume export命令也已在远程客户端可用。podman build的--build-context选项现在支持远程客户端。podman volume create命令新增--uid和--gid选项。podman secret create命令新增--ignore选项。podman pull命令新增--policy选项。--mount type=artifact选项现在允许使用name=选项设置制品文件名。--tmpfs选项现在支持noatime参数。podman update命令新增--latest选项。新增了podman buildx inspect命令以提高 Docker 兼容性。
改动方面,podman artifact 命令套件现在被视为稳定。在 M3 或更新主机上使用 libkrun 提供程序运行 podman machine 虚拟机时,默认启用嵌套虚拟化。在 Windows 上使用 WSL v2 提供程序创建 podman machine 虚拟机时,镜像现在作为制品从 quay.io/podman/machine-os 拉取。--sig-proxy 选项的信号转发现在更加健壮,不再转发 SIGSTOP 信号。podman system check --quick 命令现在跳过检查层摘要。在 Windows 上使用 WSLv2 提供程序的 Podman 现在优先使用 C:\Program Files\Windows Subsystem for Linux\wsl.exe 中的 WSL 可执行文件。--mount type=artifact 选项现在将仅包含单个 blob 的制品挂载为文件。podman volume export 命令现在拒绝在 TTY 上导出到标准输出。Quadlet 在生成包含已知与 Podman 不兼容选项(如 User=、Group=、DynamicUser=)的单元时会警告用户。
修复了一系列错误,包括:--security-opt unmask= 选项不接受逗号分隔路径列表;停止容器可能意外杀死非 Podman 进程;podman machine init 在 Podman 容器内运行时可能失败;podman machine 虚拟机可能收到不正确的时区信息;使用自定义用户名创建的 podman machine 虚拟机未启用 lingering;Windows 上 podman machine init 使用 WSL 2 提供程序时检测 WSL 安装不可靠;未指定 PodName= 键的 Quadlet .pod 单元名称设置错误;加入 .pod 单元中指定 pod 的 Quadlet .container 单元创建容器时 pod 名称设置错误;Quadlet 在挂载 Type=bind 的 .volume 单元时未生成 RequiresMountsFor;相同名称的 dropin 文件在不同层级未正确覆盖;解析单元失败时未打印警告;.pod 文件生成的 systemd 服务未包含 [Service] 部分中最后一个 Environment= 键;启动具有已运行依赖项的容器会失败;使用 --hooks-dir 指定的目录中的 OCI 钩子在容器重启时无法运行;--mount 选项在未指定 type= 时未默认为 volume;Windows 上 podman kube play 指定 YAML 文件绝对路径时失败;Windows 上 --security-opt seccomp= 选项在指定 Seccomp 配置文件路径时可能出错;--blkio-weight-device 等选项错误地接受非块设备;podman build 处理 --ignorefile 选项的方式与 buildah bud 不同;podman rm -f 尝试删除 conmon 进程已被终止的运行容器时可能出错;podman inspect 在 containers.conf 中设置了 log_size_max 时未正确显示容器日志大小。
API 方面,添加了与制品交互的完整端点集,包括检查、列出、拉取、删除、添加、推送和提取制品。容器兼容创建端点新增 HostConfig.CgroupnsMode 参数以指定 cgroup 命名空间模式,并遵守 containers.conf 中的 base_hosts_file 选项。系统信息兼容端点新增 DefaultAddressPools 字段。系统 DF 兼容端点移除了已弃用的 BuilderSize 字段。Ping 兼容端点将 Builder-Version 设置为 1 以匹配不含 BuildKit 的 Docker 安装。镜像兼容列表端点现在无条件返回 shared-size 字段。镜像兼容检查端点在请求 Docker API 版本 1.44 及更高版本时不再返回已弃用的 VirtualSize 字段。修复了兼容删除 API 在 FORCE 参数为 true 时删除运行容器的错误(Docker 仅删除已停止容器);兼容列表和检查端点返回容器状态时使用 Podman 状态而非 Docker 兼容状态;超时的健康检查未正确终止(现在会发送 SIGTERM,超时后发送 SIGKILL);application/json 响应被 HTML 转义的问题。
其他方面,Quadlet 停止容器时不再使用容器/pod ID 文件,而是直接传递名称。通过 Makefile 构建 Podman 时,现在会尝试动态链接已安装的 sqlite3 库,这与其他优化应能显著减小二进制文件大小。更新了 Buildah 至 v1.41.1、containers/common 至 v0.64.1、containers/storage 至 v1.59.1、containers/image 至 v5.36.1。
更新内容 (中文)
功能特性
- 新增一套管理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,可在创建的虚拟机中启用交换分区并设置其大小(单位为MB)(#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)。podman artifact系列用于交互OCI制品的命令现在可在远程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)。
变更
podman artifact系列用于交互OCI制品的命令现在被视为稳定功能。- 对于在M3或更新主机上运行macOS 15+并使用
libkrun提供程序运行podman machine虚拟机的用户,默认启用嵌套虚拟化。 - 在Windows上使用WSL v2提供程序创建
podman machine虚拟机时,现在从quay.io/podman/machine-os作为制品拉取镜像,与其他虚拟机提供程序的行为保持一致。 podman run和podman attach的--sig-proxy选项执行的信号转发现在对竞态条件更具鲁棒性,且不再转发SIGSTOP信号。podman system check --quick命令现在跳过检查层摘要。- 在Windows上使用WSL v2提供程序的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命令现在拒绝在TTY时导出到STDOUT(#26506)。- 在生成使用已知在Podman中存在问题的选项(如单元
[Service]部分的User=、Group=和DynamicUser=)的Quadlet单元时,Quadlet现在会警告用户潜在的兼容性问题(#26543)。
错误修复
- 修复了
podman create和podman run的--security-opt unmask=选项不允许传递逗号分隔路径列表,而只允许单个路径的错误。 - 修复了停止Podman容器可能意外终止非Podman进程的错误(如果在容器运行期间,容器内启动的执行会话的PID被用于新进程)(#25104)。
- 修复了在Podman容器中运行时
podman machine init可能失败的错误(#25950)。 - 修复了
podman machine虚拟机有时会收到不正确时区信息的错误。 - 修复了使用自定义用户名创建的
podman machine虚拟机未启用持续运行的错误。 - 修复了在Windows上使用WSL 2提供程序时
podman machine init命令无法可靠确定WSL是否已安装的错误(#25523)。 - 修复了未指定
PodName=键的Quadlet.pod单元名称设置不正确的错误(#26062)。 - 修复了Quadlet
.container单元加入.pod单元中指定的Pod时,由于创建容器时Pod名称设置不正确而导致失败的错误(#26105)。 - 修复了Quadlet在将设置为
Type=bind的.volume单元挂载到容器中时未生成RequiresMountsFor的错误(#26125)。 - 修复了Quadlet插入文件未被层级中后续同名插入文件正确覆盖(如果两个插入文件没有共享父目录)的错误(#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)。 - 修复了在Windows上为
podman create、podman run和podman pod create的--security-opt seccomp=选项提供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)。 - 修复了
podman rm -f命令在尝试移除其conmon进程已被终止的运行容器时可能返回错误的错误(#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)。 - 容器的Compat Create端点现在接受新参数
HostConfig.CgroupnsMode,用于指定创建容器的cgroup命名空间模式。 - 容器的Compat Create端点现在尊重
containers.conf中的base_hosts_file选项。 - Compat System Info端点现在返回新字段
DefaultAddressPools。 - Compat System DF端点已移除已弃用的
BuilderSize字段。 - Compat Ping端点现在将
Builder-Version设置为1,以匹配不包含BuildKit的Docker安装。 - 镜像的Compat List端点现在无条件返回
shared-size字段,即使未将shared-size查询参数设置为true。如果未通过查询参数请求,则设置为-1。这提高了Docker API兼容性。 - 当请求Docker API版本1.44及以上时,镜像的Compat Inspect端点不再返回已弃用的
VirtualSize字段。 - 修复了当
FORCE参数设置为true时,容器的Compat Delete API会移除运行容器的错误;Docker仅移除已停止的容器(#25871)。 - 修复了容器的Compat List和Compat Inspect端点使用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.1
- 更新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).
Changes
- 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.1
- 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-rc2-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