Windows 安装 Podman Desktop

  • podman 简介
    • 概述和范围
    • Roadmap 路线图
    • Rootless 无根
  • podman 安装说明
    • Podman for Windows
    • 前置条件
    • 安装 podman
      • 自动 WSL 安装
      • 机器初始化过程
      • 启动 machine
    • Rootful & Rootless
    • 安装 podman desktop
  • podman 命令介绍
    • podman -h
    • podman machine -h
  • 参考文档

podman 简介

Podman:用于管理 OCI 容器和 Pod 的工具
Podman: A tool for managing OCI containers and pods


Podman(POD MANager) 是一个用于管理容器和映像、挂载到这些容器中的卷以及由容器组组成的 pod 的工具。PodmanLinux 上运行容器,但也可以使用 Podman 管理的虚拟机在 MacWindows 系统上使用。 Podman 基于 libpodlibpod 是一个用于容器生命周期管理的库,也包含在此存储库中。libpod 库提供了用于管理 containers(容器)、podscontainer images(容器镜像)和 volumes(卷)的 API

概述和范围

在高层次上,Podmanlibpod 的范围如下:

  • 支持多种容器镜像格式,包括 OCIDocker 镜像。
  • 全面管理这些映像,包括从各种来源拉取(包括信任和验证)、创建(通过 ContainerfileDockerfile 构建或从容器提交)以及推送到注册表和其他存储后端。
  • 容器生命周期的全面管理,包括创建(从映像和松散的根文件系统)、运行、检查点和恢复(通过 CRIU)以及删除。
  • 使用 Netavark 全面管理容器网络。
  • 支持 Pod,即共享资源并一起管理的容器组。
  • 支持在没有 root 或其他提升权限的情况下运行容器和 Pod
  • 容器和 Pod 的资源隔离。
  • 支持 Docker 兼容的 CLI 接口,该接口既可以在本地运行容器,也可以在远程系统上运行容器。
  • 无管理器守护进程,以提高安全性并降低空闲时的资源利用率。
  • 支持 REST API,提供与 Docker 兼容的接口和公开高级 Podman 功能的改进接口。
  • 支持通过 podman machine 运行的虚拟机在 WindowsMac 上运行。

Roadmap 路线图

  1. 功能齐全的 GUI 前端,用于 podman machine
  2. 进一步改进和 podman generate kubepodman play kube
  3. Pod 的改进,包括添加 Pod 级别的资源限制

Rootless 无根

Podman 可以作为普通用户轻松运行,不需要 setuid 二进制文件。 在没有 root 的情况下运行时,Podman 容器使用用户命名空间将容器中的 root 设置为运行 Podman 的用户。 Rootless Podman 运行锁定的容器,没有运行容器的用户没有的权限。 其中一些限制可以解除(例如,通过),但无根容器永远不会拥有比启动它们的用户更多的权限。 如果您以用户身份运行 Podman 并从主机挂载,您仍然无法更改它,因为您的用户没有这样做的权限。--privileged/etc/passwd

几乎所有正常的 Podman 功能都可用,尽管存在一些 缺点。 任何最近的 Podman 版本都应该能够在没有任何额外配置的情况下运行无根,尽管您的操作系统可能需要安装 指南 中详述的一些额外配置。

在使用无根 Podman 之前,管理员需要进行一些配置,此处 记录了必要的设置。

  • 缺点,https://github.com/containers/podman/blob/main/rootless.md
  • 指南,https://podman.io/getting-started/installation
  • 此处,https://github.com/containers/podman/blob/main/docs/tutorials/rootless_tutorial.md

podman 安装说明

Podman for Windows

虽然“容器是Linux”,但 Podman 也可以在 MacWindows 上运行。 它提供本机 CLI 并嵌入要启动的来宾 Linux 系统 您的容器。此来宾被称为 Podman 机器,并且是 使用命令进行管理。在 Windows 上,每个 Podman 机器由虚拟化的 Windows 子系统支持 Linux (WSLv2) 分发。podman 命令可以直接从你的 Windows PowerShell(或CMD)提示符,它与在 WSL 环境中运行的 podman 服务。或者,您 如果您更喜欢 Linux,可以直接从 WSL 实例访问 Podman 提示和 Linux 工具。除了命令行访问之外,Podman 同时侦听 Docker API 客户端,支持直接使用 基于 Docker 的工具和从您的语言进行编程访问 选择。podman machine

前置条件

由于 Podman 使用 WSL,因此您需要最新版本的 Windows 10Windows 11x64 上,WSL 需要内部版本 18362 或更高版本,arm64 系统需要内部版本 19041 或更高。在内部,WSL 使用 虚拟化,因此您的系统必须支持并具有硬件 已启用虚拟化。如果在 VM 上运行 Windows,则必须具有支持嵌套虚拟化的 VM

还建议安装现代的 “Windows终端”, 它提供了优于标准 PowerShell 的用户体验,并且 CMD 提示,以及 WSL 提示,如果需要的话。

你可以通过搜索 Windows 应用商店或运行 以下命令:winget

winget install Microsoft.WindowsTerminal

安装 podman

下载地址,https://github.com/containers/podman/releases

安装 Windows Podman 客户端首先要下载 Podman Windows installer(安装程序)。Windows 安装程序是随每个 Podman 版本构建的,可以从 Github 官方发布页面下载。请确保下载本指南中讨论的功能的 4.5.1 或更高版本。


下载后,只需运行该文件,然后重新启动一个新的终端。在这一点之后,podman.exe 将出现在您的 PATH 上,您将能够运行该命令来创建您的第一台计算机。

podman machine init

自动 WSL 安装

如果您的系统上尚未安装 WSL,则第一个 machine init 命令将提示一个对话框以开始自动安装。如果接受,此过程将安装必要的 Windows 组件,重新启动系统,并在登录后在 终端窗口 中重新启动计算机创建过程。请确保等待一两分钟以重新启动,因为 Windows 在执行启动项目之前会有延迟。或者,您可以拒绝自动安装并手动安装 WSL。但是,这将需要额外的下载和设置时间。

机器初始化过程

安装 WSL 后,init 命令将安装一个最小化的 Fedora,并对其进行自定义以运行 podman

Downloading VM image: fedora-podman-amd64-v37.0.38.tar.xz: done
Extracting compressed file
Importing operating system into WSL (this may take a few minutes on a new WSL install)...
正在导入,这可能需要几分钟时间。
操作成功完成。
Configuring system...
Generating public/private ed25519 key pair.
Your identification has been saved in podman-machine-default
Your public key has been saved in podman-machine-default.pub
The key fingerprint is:
SHA256:eq+hsYHASu6jvSZZncjqQpi6K+a2KCAlgmQQmwr1pCg root@master-jeff
The key's randomart image is:
|+.. .            |
| B +             |
|E . .            |
|B..              |
|+*oo .  S        |
|Bo+.o. .         |
|*=  . + o        |
|@=.    * o       |
|#X=.  o ...      |
+----[SHA256]-----+
Machine init complete
To start your machine run:podman machine start

启动 machine

machine 初始化过程完成后,可以根据需要启动和停止:

PS C:\Users\Jeffery.Chai> podman machine start
Starting machine "podman-machine-default"This machine is currently configured in rootless mode. If your containers
require root permissions (e.g. ports < 1024), or if you run into compatibility
issues with non-podman clients, you can switch using the following command:podman machine set --rootfulAPI forwarding listening on: npipe:./pipe/docker_engineDocker API clients default to this address. You do not need to set DOCKER_HOST.
Machine "podman-machine-default" started successfully

此计算机当前配置为无根(rootless)模式。如果您的容器需要 root 权限(例如端口 < 1024),或者如果遇到兼容性问题
对于非 podman 客户端的问题,可以使用以下命令进行切换:podman machine set --rootful

Rootful & Rootless

在嵌入式 WSL Linux 发行版上,podman 可以在根用户(rootful)或非特权用户(rootless)下运行。为了在 Linux 上与 Podman 保持行为一致性,无根是默认设置。

注意:有根(rootful)容器和无根(rootless)容器是不同的,并且彼此隔离。针对其中一个的 Podman 命令(例如,Podman-ps)不会代表另一个的结果/状态。

虽然大多数容器在无根(rootless)设置中运行良好,但您可能会发现容器仅在具有根权限的情况下运行。如果是这种情况,您可以通过停止机器并使用 set 命令将其切换到 rootful

podman machine stop
podman machine set --rootful

要恢复无根(rootless)执行,请将 rootful 设置为 false

Podman machine stop
Podman machine set --rootful=false

安装 podman desktop

  1. 访问官网的 desktop下载地址:https://podman-desktop.io/downloads/Windows


2. 使用 Windows 安装程序静默安装 Podman Desktop,https://podman-desktop.io/docs/installation/windows-install/installing-podman-desktop-silently-with-the-windows-installer


考虑使用此方法在没有用户交互的情况下安装 Podman Desktop Windows 安装程序。

执行步骤:

  • 下载 Windows 安装程序。
  • 运行 PowerShell 命令:
Start-Process -FilePath '.\podman-desktop-0.10.0-setup.exe' -ArgumentList "\S" -Wait


此处我是用 winget 命令,在命令行中执行 podman desktop 安装:

winget install -e --id RedHat.Podman-Desktop

PS C:\Users\Jeffery.Chai> winget install -e --id RedHat.Podman-Desktop
已找到 Podman Desktop [RedHat.Podman-Desktop] 版本 1.1.0
此应用程序由其所有者授权给你。
Microsoft 对第三方程序包概不负责,也不向第三方程序包授予任何许可证。
正在下载 https://github.com/containers/podman-desktop/releases/download/v1.1.0/podman-desktop-1.1.0-setup.exe██████████████████████████████   113 MB /  113 MB
已成功验证安装程序哈希
正在启动程序包安装...
已成功安装

此时桌面已经出现 Podman Desktop 图标,点击运行界面展示如下:

  • podman desktop dashboard

  • podman desktop containers

  • podman desktop pods

  • podman desktop images

  • podman desktop volumes

podman 命令介绍

基本上每个命令的使用都可以使用 podman [options] [command] -h 套路查看更多信息。

podman -h

PS C:\Users\Jeffery.Chai> podman -h
Manage pods, containers and imagesUsage:podman.exe [options] [command]Available Commands:attach      Attach to a running containerbuild       Build an image using instructions from Containerfilescommit      Create new image based on the changed containercontainer   Manage containerscp          Copy files/folders between a container and the local filesystemcreate      Create but do not start a containerdiff        Display the changes to the object's file systemevents      Show podman system eventsexec        Run a process in a running containerexport      Export container's filesystem contents as a tar archivegenerate    Generate structured data based on containers, pods or volumeshealthcheck Manage health checks on containershelp        Help about any commandhistory     Show history of a specified imageimage       Manage imagesimages      List images in local storageimport      Import a tarball to create a filesystem imageinfo        Display podman system informationinit        Initialize one or more containersinspect     Display the configuration of object denoted by IDkill        Kill one or more running containers with a specific signalkube        Play containers, pods or volumes from a structured fileload        Load image(s) from a tar archivelogin       Login to a container registrylogout      Logout of a container registrylogs        Fetch the logs of one or more containersmachine     Manage a virtual machinemanifest    Manipulate manifest lists and image indexesnetwork     Manage networkspause       Pause all the processes in one or more containerspod         Manage podsport        List port mappings or a specific mapping for the containerps          List containerspull        Pull an image from a registrypush        Push an image to a specified destinationrename      Rename an existing containerrestart     Restart one or more containersrm          Remove one or more containersrmi         Removes one or more images from local storagerun         Run a command in a new containersave        Save image(s) to an archivesearch      Search registry for imagesecret      Manage secretsstart       Start one or more containersstats       Display a live stream of container resource usage statisticsstop        Stop one or more containerssystem      Manage podmantag         Add an additional name to a local imagetop         Display the running processes of a containerunpause     Unpause the processes in one or more containersuntag       Remove a name from a local imageupdate      update an existing containerversion     Display the Podman version informationvolume      Manage volumeswait        Block on one or more containersOptions:-c, --connection string         Connection to use for remote Podman service (default "podman-machine-default")--help                      Help for podman--identity string           path to SSH identity file, (CONTAINER_SSHKEY) (default "C:\\Users\\Jeffery.Chai\\.ssh\\podman-machine-default")--log-level string          Log messages above specified level (trace, debug, info, warn, warning, error, fatal, panic) (default "warn")--noout                     do not output to stdout--ssh string                define the ssh mode (default "golang")--storage-opt stringArray   Used to pass an option to the storage driver--url string                URL to access Podman service (CONTAINER_HOST) (default "ssh://user@127.0.0.1:61683/run/user/1000/podman/podman.sock")-v, --version                   version for podman.exe

podman machine -h

PS C:\Users\Jeffery.Chai> podman machine -h
Manage a virtual machineDescription:Manage a virtual machine. Virtual machines are used to run Podman.Usage:podman.exe machine [command]Available Commands:info        Display machine host infoinit        Initialize a virtual machineinspect     Inspect an existing machinelist        List machinesos          Manage a Podman virtual machine's OSrm          Remove an existing machineset         Sets a virtual machine settingssh         SSH into an existing machinestart       Start an existing machinestop        Stop an existing machine

更多详细信息,请自行安装尝试,赶快动手实践哟!

参考文档

  • https://github.com/containers/podman
  • https://podman-desktop.io/docs/intro
  • Podman for Windows.html

Windows 安装 Podman Desktop相关推荐

  1. windows安装docker desktop

    windows安装docker desktop 前言 一.docker desktop 是什么? 二.安装步骤 1.下载 2.安装 总结 前言   这里针对windows 10 家庭中文版,其他版本部 ...

  2. 【网址收藏】windows安装Docker Desktop常见问题整理

    安装Docker Desktop报错WSL 2 installation is incomplete. https://blog.csdn.net/qq_39611230/article/detail ...

  3. windows安装docker desktop以及配置

    一.(我的电脑不需要)下载wsl2需要的linux内核: 参考:https://docs.microsoft.com/zh-cn/windows/wsl/wsl2-kernel 二.windows中安 ...

  4. Windows 安装 Podman

    文章目录 1. 准备条件 2. 安装 podman 1. 准备条件 bcdedit /set hypervisorlaunchtype auto C:\WINDOWS\system32>bcde ...

  5. Docker Desktop for Windows 安装过程整理

    文章目录 前言 Docker Desktop for Windows 安装过程整理 01 Docker Desktop for Windows 安装 02 增加镜像加速地址 前言   如果您觉得有用的 ...

  6. ​Podman Desktop: 一款超高颜值和功能强大的 Podman 桌面管理工具

    公众号关注 「奇妙的 Linux 世界」 设为「星标」,每天带你玩转 Linux ! Podman 是一个 RedHat 公司发布的开源容器管理工具,初衷就是 Docker 的替代品,在使用上与 Do ...

  7. 安装docker desktop for windows启动时报错

    安装过程中报错 docker desktop : Hardware assisted virtualization and data execution protection must be enab ...

  8. Docker学习之Windows Home上安装Docker Desktop的完整图文教程

    Windows Home上安装Docker Desktop的完整图文教程 记录安装过程,文字略显沙雕✧٩(ˊωˋ*)و✧ 来自Docker官方文档: 支持的平台 Docker Engine可 通过Do ...

  9. Docker Desktop for Windows 安装步骤

    Doker Desktop for Windows 安装要求 Docker Desktop for Windows需要运行Microsoft Hyper-V.如果需要,Docker Desktop f ...

最新文章

  1. Linux服务器-使用mysql
  2. Magento入门基础 - 后台如何批量导入产品及产品图片
  3. foreach无法给外部变量赋值(Local variable decimal defined in an enclosing scope must be final or effectively )
  4. 使用Excel调用ABAP系统的函数
  5. 你要知道的开源地理空间软件10件事
  6. java object转泛型_JAVA快速入门——基本结构、基本数据类型
  7. RSS Feed Generator for PHP (兼有podcast rss - iTunes )
  8. 存储过程是用来干什么的_感情不是用来考验的
  9. thinkphp3 页面跳转外部链接_一文看懂小程序跳转的规则和注意事项
  10. 第一次作业:深入源码分析进程模型
  11. UnityShader9.1:光照基础实例
  12. 手机怎么用java9_java9_java9官方版 32位64位 最新版_天天下载手机版
  13. VMP2.0版本带壳调试教程
  14. 你在被窝里刷手机岁月静好,一个名叫 Flink 的 ​“神秘引擎” 却在远方和时间赛跑...
  15. python pdfminer3k_python 使用pdfminer3k 读取PDF文档的例子
  16. Pytorch测试模型的GFLOPs和Param大小
  17. PLC基础知识(PLC入门必看)
  18. 深入浅出面板数据分析
  19. web前端--TS基础理论及原理
  20. Kaggle(入门)

热门文章

  1. 绑定-关于RelativeSource
  2. Transformer详解(二):Attention机制
  3. qt connect重复 槽函数会重复触发
  4. 通用漏洞评估方法CVSS 3.0 计算公式及说明
  5. SuperBlock损坏修复
  6. 有没有不限制群发数量的软件?
  7. python爬取指定关键字图片
  8. angle-normals-ts 求三角形法线 画小刺兔
  9. Java高级篇之网络通讯
  10. web 垂直对齐方式 vertical-align属性