发布日期: 2024-07-23
版本号: v5.2.0-rc2

Podman近期更新包含多项功能增强与问题修复。主要新增特性包括:Quadlet支持.build文件以构建镜像,.container文件新增LogOpt和StopSignal配置项,.container和.pod文件支持NetworkAlias网络别名,并扩展了配置文件搜索路径;新增podman system check命令用于检测和修复本地容器存储问题,podman machine reset命令可重置当前系统所有虚拟机环境。重要变更涉及Linux内核最低版本要求提升至5.2,Quadlet镜像单元依赖网络在线状态,–device选项在特权模式下生效,虚拟机改用virtiofs提升挂载性能,构建命令允许同时使用–squash和–layers=false,以及容器停止超时设置优化。修复了包括rootless容器通知异常、hosts文件格式错误、数据库配置冲突、内存分配越界、事件上报失败等多项问题。API方面支持多架构镜像构建并修正错误响应格式。此外,优化了权限检查逻辑、错误提示信息,Windows安装程序升级至WiX 5构建工具。

更新内容 (中文)

新功能

  • Quadlet 现在支持 .build 文件,允许通过 Quadlet 构建镜像并供 Quadlet 容器使用
  • Quadlet .container 文件新增两个字段:LogOpt 用于指定容器日志配置,StopSignal 用于指定容器停止信号 (#23050)
  • Quadlet .container.pod 文件新增 NetworkAlias 字段以添加网络别名
  • 扩展 Quadlet 附加配置文件搜索路径,包含顶层类型附加配置(container.dpod.d)和截断单元附加配置(unit-.container.d)(#23158)
  • 新增 podman system check 命令用于检测(并尽可能修复)本地容器存储的损坏
  • podman machine reset 命令现在会重置当前操作系统上所有可用提供程序(例如确保 Windows 系统同时删除 HyperV 和 WSL 的 podman machine 虚拟机)

变更

  • Podman 现在需要新的内核挂载 API,依赖 Linux 内核版本 v5.2 或更高
  • Quadlet .image 单元现在依赖 network-online.target (#21873)
  • 修复当同时指定 --privilegedpodman createpodman run--device 选项被忽略的问题 (#23132)
  • podman startpodman stop 命令不再打印完整 Pod ID,改为显示用户输入的标识符(例如 podman pod start b 将输出 b 而非完整 ID)(#22590)
  • Linux 系统上 podman machine 创建的虚拟机现使用 virtiofs 替代 9p 挂载主机文件系统,现有挂载将在虚拟机重启或重建时自动迁移,提升挂载性能和可靠性
  • 允许 podman build 同时使用 --squash--layers=false 选项
  • Podman 现在在创建 cgroups 时会向 systemd 传递容器停止超时参数,确保 systemd 停止作用域时遵守该设置,防止因运行中的 Podman 容器导致系统关机卡死
  • podman machine init--volume-driver 选项现已弃用

错误修复

  • 修复使用 --sdnotify=healthy 选项创建的无根容器在启动时可能崩溃的问题 (#22651)
  • 修复使用 --sdnotify=healthy 选项的容器快速退出时可能返回错误而非发送就绪通知的问题 (#22760)
  • 修复 podman system reset 未清除容器/镜像 blob 缓存的问题 (#22825)
  • 修复指定 --cgroups=disabled 时 Podman 仍可能为自身创建 cgroup 的问题 (#20910)
  • 修复容器内 /etc/hosts 文件末尾缺少换行符的问题 (#22729)
  • 修复 podman start 命令在启动已停止状态的容器时可能崩溃的问题
  • 修复使用 sqlite 数据库后端时,存在卷的情况下 podman system renumber 执行失败的问题 (#23052)
  • 修复 podman container restore 无法成功恢复 Pod 内容器的问题
  • 修复远程客户端使用 podman diff 时错误提示建议使用 --latest 选项的问题 (#23038)
  • 修复用户可为 Podman 虚拟机分配超过主机物理内存的问题 (#18206)
  • 修复 podman events 偶尔无法报告发生错误的问题 (#23165)
  • 修复使用 --cidfile 选项时 systemd 单元内运行的容器退出后可能未被正确清除的问题
  • 修复使用瞬时模式时,重启后首次运行 Podman 命令可能导致卡死的问题 (#22984)
  • 修复主机不存在特定路径时 Podman 可能报数据库配置不匹配错误的问题
  • 修复当其他 Podman 进程在启动中途停止容器时,podman runpodman start 可能抛出异常错误的问题 (#23246)
  • 修复 podman system service 终止时可能泄漏挂载点的问题
  • 修复远程客户端传递无效镜像过滤器到 podman images 时崩溃的问题 (#23120)
  • 修复运行过程中容器被删除时 podman auto-updatepodman system df 可能失败的问题 (#23279)
  • 修复准备虚拟机镜像时 podman machine init 尝试解压空文件导致崩溃的问题 (#23281)
  • 修复执行过程中 Pod 被删除时 podman ps --podpodman pod stats 可能失败的问题 (#23282)
  • 修复显示所有容器(或 pod stats 的 Pod 容器)时,若运行中有容器停止,podman statspodman pod stats 可能因 container is stopped 错误退出的问题 (#23334)
  • 修复容器健康检查输出未包含最终换行符时日志记录异常的问题 (#23332)

API

  • 镜像构建 API 现支持在 Platform 查询参数中使用逗号分隔列表,允许单次 API 调用构建多架构镜像 (#22071)
  • 修复调用模糊卷名时 Volume 删除端点返回错误格式不正确的问题 (#22616)
  • 修复对不存在的容器调用统计端点时返回错误格式不正确的问题 (#22612)
  • 修复 Pod 启动端点在应返回 500 错误码时返回 409 错误码的问题 (#22989)
  • 修复 Pod 进程列表端点先返回 200 状态码再报错的问题 (#22986)

其他

  • Podman 不再要求其根目录和运行目录的所有父目录具备全局可执行权限 (#23028)
  • 改进 podman build-f 选项指向不存在的文件时的错误提示 (#22940)
  • Podman Windows 安装包现使用 WiX 5 构建

更新内容 (原始)

Features

  • Quadlet now has support for .build files, which allows images to be built by Quadlet and then used by Quadlet containers.
  • Quadlet .container files now support two new fields, LogOpt to specify container logging configuration and StopSignal to specify container stop signal (#23050).
  • Quadlet .container and .pod files now support a new field, NetworkAlias, to add network aliases.
  • Quadlet drop-in search paths have been expanded to include top-level type drop-ins (container.d, pod.d) and truncated unit drop-ins (unit-.container.d) (#23158).
  • Podman now supports a new command, podman system check, which will identify (and, if possible, correct) corruption within local container storage.
  • The podman machine reset command will now reset all providers available on the current operating system (e.g. ensuring that both HyperV and WSL podman machine VMs will be removed on Windows).

Changes

  • Podman now requires the new kernel mount API, introducing a dependency on Linux Kernel v5.2 or higher.
  • Quadlet .image units now have a dependency on network-online.target (#21873).
  • The --device option to podman create and podman run is no longer ignored when --privileged is also specified (#23132).
  • The podman start and podman stop commands no longer print the full ID of the pod started/stopped, but instead the user’s input used to specify the pod (e.g. podman pod start b will print b instead of the pod’s full ID) (#22590).
  • Virtual machines created by podman machine on Linux now use virtiofs instead of 9p for mounting host filesystems. Existing mounts will be transparently changed on machine restart or recreation. This should improve performance and reliability of host mounts.
  • Using both the --squash and --layers=false options to podman build at the same time is now allowed.
  • Podman now passes container’s stop timeout to systemd when creating cgroups, causing it to be honored when systemd stops the scope. This should prevent hangs on system shutdown due to running Podman containers.
  • The --volume-driver option to podman machine init is now deprecated.

Bugfixes

  • Fixed a bug where rootless containers created with the --sdnotify=healthy option could panic when started (#22651).
  • Fixed a bug where containers created with the --sdnotify=healthy option that exited quickly would sometimes return an error instead of notifying that the container was ready (#22760).
  • Fixed a bug where the podman system reset command did not remove the containers/image blob cache (#22825).
  • Fixed a bug where Podman would sometimes create a cgroup for itself even when the --cgroups=disabled option was specified at container creation time (#20910).
  • Fixed a bug where the /etc/hosts file in a container was not created with a newline at the end of the file (#22729).
  • Fixed a bug where the podman start command could sometimes panic when starting a container in the stopped state.
  • Fixed a bug where the podman system renumber command would fail if volumes existed when using the sqlite database backend (#23052).
  • Fixed a bug where the podman container restore command could not successfully restore a container in a pod.
  • Fixed a bug where an error message from podman diff would suggest using the --latest option when using the remote Podman client (#23038).
  • Fixed a bug where user could assign more memory to a Podman machine than existed on the host (#18206).
  • Fixed a bug where the podman events command was rarely unable to report errors that occurred (#23165).
  • Fixed a bug where containers run in systemd units would sometimes not be removed correctly on exit when using the --cidfile option.
  • Fixed a bug where the first Podman command run after a reboot could cause hang when using transient mode (#22984).
  • Fixed a bug where Podman could throw errors about a database configuration mismatch if certain paths did not exist on the host.
  • Fixed a bug where the podman run and podman start commands could throw strange errors if another Podman process stopped the container at a midpoint in the process of starting (#23246).
  • Fixed a bug where the podman system service command could leak a mount on termination.
  • Fixed a bug where the Podman remote client would panic if an invalid image filter was passed to podman images (#23120).
  • Fixed a bug where the podman auto-update and podman system df commands could fail when a container was removed while the command was running (#23279).
  • Fixed a bug where the podman machine init command could panic when trying to decompress an empty file when preparing the VM image (#23281).
  • Fixed a bug where the podman ps --pod and podman pod stats commands could sometimes fail when a pod was removed while the command was running (#23282).
  • Fixed a bug where the podman stats and podman pod stats commands would sometimes exit with a container is stopped error when showing all containers (or pod containers, for pod stats) if a container stopped while the command was running (#23334).
  • Fixed a bug where the output of container healthchecks was not properly logged if it did not include a final newline (#23332).

API

  • The Build API for Images now accepts a comma-separated list in the Platform query parameter, allowing a single API call to built an image for multiple architectures (#22071).
  • Fixed a bug where the Remove endpoint for Volumes would return an incorrectly formatted error when called with an ambiguous volume name (#22616).
  • Fixed a bug where the Stats endpoint for Containers would return an incorrectly formatted error when called on a container that did not exist (#22612).
  • Fixed a bug where the Start endpoint for Pods would return a 409 error code in cases where a 500 error code should have been returned (#22989).
  • Fixed a bug where the Top endpoint for Pods would return a 200 status code and then subsequently an error (#22986).

Misc

  • Podman no longer requires all parent directories of its root and runroot to be world-executable (#23028).
  • Error messages from the podman build command when the -f option is given, but points to a file that does not exist, have been improved (#22940).
  • The Podman windows installer is now built using WiX 5.

下载链接