podman v5.3.0-rc3 版本更新介绍
发布日期: 2024-11-06
版本号: v5.3.0-rc3
Podman最新版本带来多项功能更新与改进:新增对Kubernetes Job YAML的支持,强化kube generate与kube play命令在用户命名空间和镜像卷的配置能力。Quadlet功能扩展包括自定义服务名、禁用默认网络依赖、新增DNS/IP配置项、支持多镜像标签及共享容器网络等功能。Windows安装程序增加虚拟化提供商选择,新增健康检查日志配置选项与多主机名绑定支持。行为变更包括默认启用容器访问宿主机功能、优化镜像排序规则及修复退出码处理。问题修复涉及Windows构建上下文异常、命令死锁、资源泄漏、路径处理等多项稳定性改进,并优化了API对压缩文件的支持与事件响应机制。系统要求升级至Golang 1.22,同时改进了系统服务单元文件结构。
更新内容 (中文)
新功能
podman kube generate和podman kube play命令现在支持创建和运行 Kubernetes Job YAML(#17011)。podman kube generate命令现在会在生成的 YAML 中包含 Pod 和容器的用户命名空间信息。podman kube play命令将利用此信息在基于 YAML 创建新 Pod 时复现用户命名空间配置。podman kube play命令现在支持类型为image的 Kubernetes 卷(#23775)。- 现在可以通过所有支持的 Quadlet 文件中的
ServiceName键设置 Quadlet 生成的 systemd 单元的服务名称(#23414)。 - 所有 Quadlet 文件现支持通过新键
DefaultDependencies禁用对network-online.target的隐式依赖(#24193)。 - Quadlet 的
.container和.pod文件现支持新键AddHost,用于向容器或 Pod 添加主机条目。 - Quadlet 的
.container和.pod文件中的PublishPort键现在支持在值中使用变量(#24081)。 - Quadlet 的
.container文件现支持两个新键CgroupsMode和StartWithPod,分别用于配置容器的控制组模式及容器是否随所属 Pod 启动(#23664 和 #24401)。 - Quadlet 的
.container文件现在可通过在Network键中指定共享网络的容器对应的.container文件来复用其网络。 - Quadlet 的
.container文件现在可以通过Mount=type=image键将.image文件管理的镜像挂载到容器中。 - Quadlet 的
.pod文件现支持六个新键DNS、DNSOption、DNSSearch、IP、IP6和UserNS,用于配置 Pod 的 DNS、静态 IP 及用户命名空间设置(#23692)。 - Quadlet 的
.image文件现在可通过多次指定ImageTag键为镜像添加多个标签(#23781)。 - Quadlet 文件现在可放置在
/run/containers/systemd目录,同时兼容原有目录如$HOME/containers/systemd和/etc/containers/systemd/users。 - Quadlet 现在能正确处理单元目录中子目录为符号链接的情况(#23755)。
podman manifest inspect命令的输出现在包含清单的注解信息。podman inspect命令针对容器的输出新增字段HostConfig.AutoRemoveImage,显示容器是否通过--rmi选项创建。podman inspect命令针对容器的输出新增字段Config.ExposedPorts,包含容器所有暴露的端口,增强 Docker 兼容性。podman inspect命令针对容器的输出新增字段Config.StartupHealthCheck,显示容器的启动健康检查配置。podman machine list命令新增选项--all-providers,可列出所有支持的虚拟机提供商的机器。- 在 Windows 上通过
podman machine运行的虚拟机现通过主机文件系统的 Unix 套接字转发提供 API 访问(#23408)。 podman buildx prune和podman image prune命令新增选项--build-cache,可同时清理构建缓存。- Windows 安装程序新增单选按钮用于选择虚拟化提供商(WSLv2 或 Hyper-V)。
podman create、podman run和podman pod create的--add-host选项现支持分号分隔的多个主机名(例如podman run --add-host test1;test2:192.168.1.1)(#23770)。podman run和podman create命令现支持三个新选项用于配置健康检查日志:--health-log-destination(指定日志存储位置)、--health-max-log-count(指定保留的健康检查日志数量)和--health-max-log-size(指定日志最大尺寸)。
变更
- Podman 现在默认使用 Pasta 的
--map-guest-addr选项,为/etc/hosts中的host.containers.internal条目提供默认主机访问支持(#19213)。 - Quadlet 创建的 Pod 的基础容器名称变更为 Pod 名称后加
-infra后缀(#23665)。 podman system connection add命令现在支持tcp://URL 中指定的 HTTP 路径前缀。containers.conf中声明的代理环境变量(如https_proxy)在podman machine虚拟机中不再转义特殊字符(#23277)。podman images --sort=repository命令现在同时按镜像标签排序,确保输出顺序确定性(#23803)。- 当用户同时运行 rootless
podman machine虚拟机和已初始化的 rootfulpodman machine虚拟机时,若删除 rootless 虚拟机,第二个 rootful 虚拟机的连接将自动设为默认(#22577)。 - 环境变量密钥不再出现在使用该密钥的容器的
podman inspect输出中(#23788)。 - Podman 默认不再在收到 SIGTERM 时返回退出码 0。
- Podman 不再显式设置资源限制为默认值,以避免先前设置更高值时被覆盖。
- Quadlet 用户单元现通过新服务
podman-user-wait-network-online.service正确等待网络就绪,替代原用户会话中无效的network-online.target。 podman ps输出中的暴露端口在已发布时会正确分组和去重(#23317)。- Quadlet 构建单元默认不再使用
RemainAfterExit=yes。
错误修复
- 修复了 Windows 上
podman build的--build-context选项失效的问题(影响 Visual Studio Dev Containers 兼容性)(#17313)。 - 修复了使用
SecurityLabelDisable或SecurityLabelNested键时 Quadlet 生成错误 Podman 参数的问题(#23432)。 - 修复了
PODMAN_COMPOSE_WARNING_LOGS环境变量无法抑制podman compose警告日志的问题。 - 修复了在移除过程中对容器执行
podman container cleanup可能报错的问题。 - 修复了当
/etc/containers/systemd为符号链接时,rootless Quadlet 单元被错误加载到 root 用户的问题(#23483)。 - 修复了远程 Podman 客户端的
podman stop命令在--cidfile指向不存在的文件且设置--ignore时停止所有容器的问题(#23554)。 - 修复了
podman wait在通过on-failure重启策略快速退出并重启的容器上需等待 20 秒才退出的问题。 - 修复了
podman volume rm和podman run -v同时对同一卷操作时可能死锁的问题(#23613)。 - 修复了在创建过程中对容器执行
podman mount可能报错"容器已存在"的问题(#23637)。 - 修复了
podman stop在具有超大注解的容器上可能死锁的问题(#22246)。 - 修复了 macOS 上
podman machine stop在虚拟机无法正常停止时可能段错误的问题(#23654)。 - 修复了
podman stop未确保通过--rm创建的容器在退出时被移除的问题(#22852)。 - 修复了
podman run的--rmi选项在分离式容器中失效的问题。 - 修复了 FreeBSD 上
podman inspect输出HostConfig.Device字段值错误的问题(影响 Ansible Podman 模块兼容性)。 - 修复了 rootless Podman 使用
--cgroup-parent选项启动容器失败的问题(#23780)。 - 修复了
podman build -v未正确处理 Windows 路径作为宿主机目录的问题。 - 修复了 Podman 在创建网络命名空间时被中断可能导致网络命名空间文件泄漏的问题(#24044)。
- 修复了远程 Podman 客户端的
podman run在使用--rm选项时可能无法获取容器退出码的问题。 - 修复了 Windows 上
podman machine对含特殊字符的用户名无法运行虚拟机的问题。 - 修复了 Quadlet 在 root 用户下拒绝
RemapUsers=keep-id的问题。 - 修复了卷的 XFS 配额不唯一的问题(所有使用配额的卷共享最新创建卷的最大尺寸和 inode 数)。
- 修复了 Quadlet 文件的
Service段仅使用默认值而忽略用户输入的问题(#24322)。
API
- Kubernetes YAML 的 Play API 现支持
application/x-tar压缩上下文目录(#24015)。 - 修复了容器附加 API(兼容端点和 Libpod 端点)中因竞态条件导致间歇性失败的问题(#23757)。
- 修复了兼容端点容器 Top API 输出未正确分割为数组的问题(#23981)。
- 修复了通过套接字激活的 systemd 服务运行
podman system service时 Info API 可能失败的问题(#24152)。 - 修复了容器事件和日志端点现在立即发送状态码(原需等待首个事件或日志行发送)(#23712)。
其他
- Podman 现在要求 Go 1.22 或更高版本进行构建。
- 优化了在已有虚拟机运行时执行
podman machine start的输出提示(#23436)。 - Quadlet 在解析单元目录时不再记录虚假的 ENOENT 错误(#23620)。
- Docker 别名 shell 脚本现在会检查
$XDG_CONFIG_HOME/containers/nodocker文件以决定是否显示 Podman 使用警告。 - podman-auto-update 的 systemd 单元文件已移至仓库的
contrib/systemd/system目录以保持一致性。
更新内容 (原始)
Features
- The
podman kube generateandpodman kube playcommands can now create and run Kubernetes Job YAML (#17011). - The
podman kube generatecommand now includes information on the user namespaces for pods and containers in generated YAML. Thepodman kube playcommand uses this information to duplicate the user namespace configuration when creating new pods based on the YAML. - The
podman kube playcommand now supports Kubernetes volumes of type image (#23775). - The service name of systemd units generated by Quadlet can now be set with the
ServiceNamekey in all supported Quadlet files (#23414). - Quadlets can now disable their implicit dependency on
network-online.targetvia a new key,DefaultDependencies, supported by all Quadlet files (#24193). - Quadlet
.containerand.podfiles now support a new key,AddHost, to add hosts to the container or pod. - The
PublishPortkey in Quadlet.containerand.podfiles can now accept variables in its value (#24081). - Quadlet
.containerfiles now support two new keys,CgroupsModeandStartWithPod, to configure cgroups for the container and whether the container will be started with the pod it is part of ([#23664](htt
ps://github.com/containers/podman/issues/23664) and #24401). - Quadlet
.containerfiles can now use the network of another container by specifying the.containerfile of the container to share with in theNetworkkey. - Quadlet
.containerfiles can now mount images managed by.imagefiles into the container by using theMount=type=imagekey with a.imagetarget. - Quadlet
.podfiles now support six new keys,DNS,DNSOption,DNSSearch,IP,IP6, andUserNS, to configure DNS, static IPs, and user namespace settings for the pod ([#23692](https://github.com/co
ntainers/podman/issues/23692)). - Quadlet
.imagefiles can now give an image multiple times by specifying theImageTagkey multiple times (#23781). - Quadlets can now be placed in the
/run/containers/systemddirectory as well as existing directories like$HOME/containers/systemdand/etc/containers/systemd/users. - Quadlet now properly handles subdirectories of a unit directory being a symlink (#23755).
- The
podman manifest inspectcommand now includes the manifest’s annotations in its output. - The output of the
podman inspectcommand for containers now includes a new field,HostConfig.AutoRemoveImage, which shows whether a container was created with the--rmioption set. - The output of the
podman inspectcommand for containers now includes a new field,Config.ExposedPorts, which includes all exposed ports from the container, improving Docker compatibility. - The output of the
podman inspectcommand for containers now includes a new field,Config.StartupHealthCheck, which shows the container’s startup healthcheck configuration. - The
podman machine listcommand now supports a new option,--all-providers, which lists machines from all supported VM providers, not just the one currently in use. - VMs run by
podman machineon Windows will now provide API access by exposing a Unix socket on the host filesystem which forwards into the VM (#23408). - The
podman buildx pruneandpodman image prunecommands now support a new option,--build-cache, which will also clean the build cache. - The Windows installer has a new radio button to select virtualization provider (WSLv2 or Hyper-V).
- The
--add-hostoption topodman create,podman run, andpodman pod createnow supports specifying multiple hostnames, semicolon-separated (e.g.podman run --add-host test1;test2:192.168.1.1) (#2377
0). - The
podman runandpodman createcommands now support three new options for configuring healthcheck logging:--health-log-destination(specify where logs are stored),--health-max-log-count(specify how many healthchecks worth of logs are stored), and--health-max-log-size(specify the maximum size of the healthcheck log).
Changes
- Podman now uses the Pasta
--map-guest-addroption by default which is used for thehost.containers.internalentry in/etc/hoststo allow containers to reach the host by default (#19213). - The names of the infra containers of pods created by Quadlet are changed to the pod name suffixed with
-infra(#23665). - The
podman system connection addcommand now respects HTTP path prefixes specified withtcp://URLs. - Proxy environment variables (e.g.
https_proxy) declared incontainers.confno longer escape special characters in their values when used withpodman machineVMs ([#23277](https://github.com/containers/p
odman/issues/23277)). - The
podman images --sort=repositorycommand now also sorts by image tag as well, guaranteeing deterministic output ordering (#23803). - When a user has a rootless
podman machineVM running and second rootfulpodman machineVM initialized, and the rootless VM is removed, the connection to the second, rootful machine now becomes the default as expected (#22577). - Environment variable secrets are no longer contained in the output of
podman inspecton a container the secret is used in (#23788). - Podman no longer exits 0 on SIGTERM by default.
- Podman no longer explicitly sets rlimits to their default value, as this could lower the actual value available to containers if it had been set higher previously.
- Quadlet user units now correctly wait for the network to be ready to use via a new service,
podman-user-wait-network-online.service, instead of the user session’s nonfunctionalnetwork-online.target. - Exposed ports in the output of
podman psare now correctly grouped and deduplicated when they are also published (#23317). - Quadlet build units no longer use
RemainAfterExit=yesby default.
Bugfixes
- Fixed a bug where the
--build-contextoption topodman builddid not function properly on Windows, breaking compatibility with Visual Studio Dev Containers (#17313). - Fixed a bug where Quadlet would generate bad arguments to Podman if the
SecurityLabelDisableorSecurityLabelNestedkeys were used (#23432). - Fixed a bug where the
PODMAN_COMPOSE_WARNING_LOGSenvironment variable did not suppress warnings printed bypodman composethat it was redirecting to an external provider. - Fixed a bug where, if the
podman container cleanupcommand was run on a container in the process of being removed, an error could be printed. - Fixed a bug where rootless Quadlet units placed in
/etc/containers/systemd/users/would be loaded for root as well when/etc/containers/systemdwas a symlink (#23483). - Fixed a bug where the remote Podman client’s
podman stopcommand would, if called with--cidfilepointing to a non-existent file and the--ignoreoption set, stop all containers (#23554). - Fixed a bug where the
podman waitwould only exit only after 20 second when run on a container which rapidly exits and is then restarted by theon-failurerestart policy. - Fixed a bug where
podman volume rmandpodman run -vcould deadlock when run simultaneously on the same volume (#23613). - Fixed a bug where running
podman mounton a container in the process of being created could cause a nonsensical error indicating the container already existed (#23637). - Fixed a bug where the
podman stopcommand could deadlock when run on containers with very large annotations (#22246). - Fixed a bug where the
podman machine stopcommand could segfault on Mac when a VM failed to stop gracefully (#23654). - Fixed a bug where the
podman stopcommand would not ensure containers created with--rmwere removed when it exited (#22852). - Fixed a bug where the
--rmioption topodman rundid not function correctly with detached containers. - Fixed a bug where running
podman inspecton a container on FreeBSD would emit an incorrect value for theHostConfig.Devicefield, breaking compatibility with the Ansible Podman module. - Fixed a bug where rootless Podman could fail to start containers using the
--cgroup-parentoption (#23780). - Fixed a bug where the
podman build -vcommand did not properly handle Windows paths passed as the host directory. - Fixed a bug where Podman could leak network namespace files if it was interrupted while creating a network namespace (#24044).
- Fixed a bug where the remote Podman client’s
podman runcommand could sometimes fail to retrieve a container’s exit code for containers run with the--rmoption. - Fixed a bug where
podman machineon Windows could fail to run VMs for certain usernames containing special characters. - Fixed a bug where Quadlet would reject
RemapUsers=keep-idwhen run as root. - Fixed a bug where XFS quotas on volumes were not unique, meaning that all volumes using a quota shared the same maximum size and inodes (set by the most recent volume with a quota to be created).
- Fixed a bug where
Servicesection of Quadlet files would only use defaults and not respect user input (#24322).
API
- The Play API for Kubernetes YAML now supports
application/x-tarcompressed context directories (#24015). - Fixed a bug in the Attach API for Containers (for both Compat and Libpod endpoints) which could cause inconsistent failures due to a race condition (#23757).
- Fixed a bug where the output for the Compat Top API for Containers did not properly split the output into an array (#23981).
- Fixed a bug where the Info API could fail when running
podman system servicevia a socket-activated systemd service (#24152). - Fixed a bug where the Events and Logs endpoints for Containers now send status codes immediately, as opposed to when the first event or log line is sent (#23712).
Misc
- Podman now requires Golang 1.22 or higher to build.
- The output of
podman machine starthas been improved when trying to start a machine when another is already running (#23436). - Quadlet will no longer log spurious ENOENT errors when resolving unit directories (#23620).
- The Docker alias shell script will now also honor the presence of
$XDG_CONFIG_HOME/containers/nodockerwhen considering whether it should print its warning message that Podman is in use. - The podman-auto-update systemd unit files have been moved into the
contrib/systemd/systemdirectory in the repo for consistency with our other unit files.
下载链接
- podman-5.3.0-rc3-setup.exe
- podman-installer-macos-amd64.pkg
- podman-installer-macos-arm64.pkg
- podman-installer-macos-universal.pkg
- podman-remote-release-darwin_amd64.zip
- podman-remote-release-darwin_arm64.zip
- podman-remote-release-windows_amd64.zip
- podman-remote-static-linux_amd64.tar.gz
- podman-remote-static-linux_arm64.tar.gz
- shasums