podman v5.6.0-rc1 版本更新介绍
发布日期: 2025-07-25
版本号: v5.6.0-rc1
Podman发布了重要更新,新增了管理Quadlet的系列命令(安装、列表、打印、删除),并扩展了Quadlet单元文件的功能,例如支持容器环境变量从宿主机读取、Pod单元增加标签和退出策略、镜像单元增加拉取策略、网络单元指定接口名称等。命令行工具方面,
podman machine init新增--swap选项,--mount支持dest=别名,podman kube play支持限制CPU核心和内存节点、指定停止信号,同时多个命令(如卷导入导出、构建上下文、卷创建指定UID/GID、密钥创建忽略存在、拉取策略、Artifact挂载文件名、tmpfs的noatime、更新最新容器等)得到增强。错误修复涵盖了安全选项解析、容器停止进程误杀、机器初始化时区与权限、Quadlet单元名称生成与挂载依赖、Windows平台兼容性等多方面问题。API新增了完整的Artifact管理接口,并修复了容器状态显示、健康检查超时处理、JSON转义等兼容性问题。此外,系统优化包括Quadlet停止容器方式改进、构建时动态链接sqlite3以减小二进制体积,以及更新了Buildah、containers/common、containers/storage和containers/image等依赖库。
更新内容 (中文)
功能
- 新增了一组用于管理 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)。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)。
变更
- 对于在 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 上使用 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命令现在拒绝导出到 TTY 的标准输出(#26506)。- 当使用已知与 Podman 结合使用时存在问题的选项(例如单元文件
[Service]部分中的User=、Group=和DynamicUser=)生成 Quadlet 单元时,Quadlet 现在会向用户发出潜在不兼容警告(#26543)。
修复
- 修复了
podman create和podman run的--security-opt unmask=选项不允许传递逗号分隔路径列表的错误,之前仅允许单个路径。 - 修复了在容器运行时,如果容器内启动的 exec 会话的 PID 被新进程重用,停止 Podman 容器可能会无意中杀死非 Podman 进程的错误(#25104)。
- 修复了
podman machine init如果在 Podman 容器中运行可能会失败的错误(#25950)。 - 修复了
podman machine虚拟机有时会收到错误时区信息的错误。 - 修复了使用自定义用户名创建的
podman machine虚拟机未启用 lingering 的错误。 - 修复了在 Windows 上使用 WSL 2 提供程序时,
podman machine init命令无法可靠确定是否已安装 WSL 的错误(#25523)。 - 修复了未指定
PodName=键的 Quadlet.pod单元名称设置错误的错误(#26062)。 - 修复了 Quadlet
.container单元加入在.pod单元中指定的 Pod 时会失败的错误,因为创建容器时 Pod 名称设置不正确(#26105)。 - 修复了 Quadlet 在将设置了
Type=bind的.volume单元挂载到容器中时不会生成RequiresMountsFor的错误(#26125)。 - 修复了如果两个 dropin 文件不共享父目录,层级结构中更靠后且具有相同名称的新 dropin 文件无法正确覆盖 Quadlet dropin 文件的错误(#26555)。
- 修复了 Quadlet 有时在解析单元失败时不打印警告的错误(#26542)。
- 修复了 Quadlet
.pod文件在生成的 systemd 服务中未包含[Service]部分最后一个Environment=键的错误(#26521)。 - 修复了启动具有已运行依赖项的容器时会失败的错误。
- 修复了使用
--hooks-dir指定目录中的 OCI 挂钩在容器重启时无法运行的错误(#17935)。 - 修复了
podman create和podman run的--mount选项在未指定type=时要求指定而不是默认使用volume的错误(#26101)。 - 修复了在 Windows 上,
podman kube play命令在指定 YAML 文件的绝对路径时会失败的错误(#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)。 - 修复了
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)。 - 容器的兼容性创建端点现在接受新参数
HostConfig.CgroupnsMode,用于指定创建容器的 cgroup 命名空间模式。 - 容器的兼容性创建端点现在尊重
containers.conf中的base_hosts_file选项。 - 兼容性信息端点现在返回一个新字段
DefaultAddressPools。 - 修复了兼容性删除容器 API 在
FORCE参数设置为 true 时会删除运行容器的错误;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.0
- 将 containers/common 库更新至 v0.64.0
- 将 containers/storage 库更新至 v1.59.0
- 将 containers/image 库更新至 v5.36.0
更新内容 (原始)
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 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
- 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 Info endpoint now returns a new field,
DefaultAddressPools. - 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.0
- Updated the containers/common library to v0.64.0
- Updated the containers/storage library to v1.59.0
- Updated the containers/image library to v5.36.0
下载链接
- podman-5.6.0-rc1-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