Windows 安装 Podman Desktop

news2024/9/21 22:39:39

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
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-v4.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 --rootful

API forwarding listening on: npipe:./pipe/docker_engine

Docker 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

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

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

执行步骤:

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

Windows installer, version v1.1.0
此处我是用 winget 命令,在命令行中执行 podman desktop 安装:

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

winget install

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

  • podman desktop containers

podman desktop containers

  • podman desktop pods

podman desktop pods

  • podman desktop images

podman desktop images

  • podman desktop volumes

podman desktop volumes

podman 命令介绍

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

podman -h

PS C:\Users\Jeffery.Chai> podman -h
Manage pods, containers and images

Usage:
  podman.exe [options] [command]

Available Commands:
  attach      Attach to a running container
  build       Build an image using instructions from Containerfiles
  commit      Create new image based on the changed container
  container   Manage containers
  cp          Copy files/folders between a container and the local filesystem
  create      Create but do not start a container
  diff        Display the changes to the object's file system
  events      Show podman system events
  exec        Run a process in a running container
  export      Export container's filesystem contents as a tar archive
  generate    Generate structured data based on containers, pods or volumes
  healthcheck Manage health checks on containers
  help        Help about any command
  history     Show history of a specified image
  image       Manage images
  images      List images in local storage
  import      Import a tarball to create a filesystem image
  info        Display podman system information
  init        Initialize one or more containers
  inspect     Display the configuration of object denoted by ID
  kill        Kill one or more running containers with a specific signal
  kube        Play containers, pods or volumes from a structured file
  load        Load image(s) from a tar archive
  login       Login to a container registry
  logout      Logout of a container registry
  logs        Fetch the logs of one or more containers
  machine     Manage a virtual machine
  manifest    Manipulate manifest lists and image indexes
  network     Manage networks
  pause       Pause all the processes in one or more containers
  pod         Manage pods
  port        List port mappings or a specific mapping for the container
  ps          List containers
  pull        Pull an image from a registry
  push        Push an image to a specified destination
  rename      Rename an existing container
  restart     Restart one or more containers
  rm          Remove one or more containers
  rmi         Removes one or more images from local storage
  run         Run a command in a new container
  save        Save image(s) to an archive
  search      Search registry for image
  secret      Manage secrets
  start       Start one or more containers
  stats       Display a live stream of container resource usage statistics
  stop        Stop one or more containers
  system      Manage podman
  tag         Add an additional name to a local image
  top         Display the running processes of a container
  unpause     Unpause the processes in one or more containers
  untag       Remove a name from a local image
  update      update an existing container
  version     Display the Podman version information
  volume      Manage volumes
  wait        Block on one or more containers

Options:
  -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 machine

Description:
  Manage a virtual machine. Virtual machines are used to run Podman.

Usage:
  podman.exe machine [command]

Available Commands:
  info        Display machine host info
  init        Initialize a virtual machine
  inspect     Inspect an existing machine
  list        List machines
  os          Manage a Podman virtual machine's OS
  rm          Remove an existing machine
  set         Sets a virtual machine setting
  ssh         SSH into an existing machine
  start       Start an existing machine
  stop        Stop an existing machine

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

坚持

参考文档

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

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/659592.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

2023最新最全!蓝队护网初级面试题大合集!必看!

前言 1.先来个自我介绍 答&#xff1a;本人从事网络安全工作10年&#xff0c;曾在2个大厂工作过&#xff0c;安全服务、售后服务、售前、攻防比赛、安全讲师、销售经理等职位都做过&#xff0c;对这个行业了解比较全面。 随着网络安全被列为国家安全战略的一部分&#xff0c…

deepstream指北——安装配置篇

目录 一、机器配置二、安装教程1. 软件对应版本要求2. 安装 三、运行示例 参考博客&#xff1a;https://blog.csdn.net/m0_73702795/article/details/127940733 &#xff08;ps: deepstream的参考资料太少了-_-||&#xff0c;上面这个是我见过最详细的&#xff09; 一、机器配…

SDN是什么?详解软件定义网络技术原理与应用

目录 一、引言 二、SDN原理 三、SDN优势 四、SDN应用前景 五、最后的话 一、引言 SDN&#xff0c;即Software-Defined Networking&#xff0c;即软件定义网络技术&#xff0c;是近年来新兴的网络技术&#xff0c;其主要思想是将网络的控制平面和数据平面进行分离&#xff…

阿里巴巴最新出版的 Java 面试参考指南(泰山版)开源了!

谈到 Java 面试&#xff0c;相信大家第一时间脑子里想到的词肯定是金三银四&#xff0c;金九银十。好像大家的潜意识里做 Java 开发的都得在这个时候才能出去面试&#xff0c;跳槽成功率才高&#xff01;但 LZ 不这么认为&#xff0c;LZ 觉得我们做技术的一生中会遇到很多大大小…

html 前端笔记常用样式和方法

目录 textarea宽高固定 Js获取文本框中鼠标选中文本 Js设置鼠标选中文本 Js追加/清空表格 自定义CheckBox 颜色 多选框选中和反选操作多次后attr()不生效 JS转Json 选择器 textarea宽高固定 style"resize: vertical" resize: vertical 宽固定none 宽高固定bo…

Windows系统如何将frp或其他应用配置为service服务并开机自启?

本文使用WinSW实现service服务配置 WinSW&#xff08;Windows Service Wrapper&#xff09;是一个开源的 Windows 服务包装器&#xff0c;它可以将任何可执行文件&#xff08;如 Java 应用程序、Python 脚本、Ruby 脚本等&#xff09;转换为 Windows 服务&#xff0c;并为其提供…

绩点计算 - C/C++ 语法基础

某大学的GPA(绩点)计算规则如下&#xff1a; 课程百分制成绩90分对应绩点4.0&#xff0c;超过90分的&#xff0c;按90分计&#xff1b;如不足90分&#xff0c;则课程绩点 4.0 * 分数/90。 学生综合绩点按该生已修的各门课程绩点结合学分加权平均而得。 现有步步同学入学后的已…

关于VPN的一些总结和理解

关于VPN的一些总结和理解 前言一、VPN的概述二、VPN的原理2.1 原理概述2.2 虚拟网卡2.3 点对点隧道的建立 三、其他3.1 vpn和vlan的区别&#xff1f;3.2 vpn和web代理的关系&#xff1f; 参考 前言 同样的机缘巧合&#xff0c;最近看了一些关于vpn的内容&#xff0c;总结一下&a…

NVM安装使用

电脑重装了系统&#xff0c;需要重新安装软件应用&#xff0c;顺便记录一下安装过程。 NVM是一个Node的版本管理工具&#xff0c;通过NVM可以方便的切换Node的版本 安装 下载&#xff0c;去github下载 Releases coreybutler/nvm-windows 运行安装程序 使用 接下来使用…

局域网内海量文件快速复制方法

遇到的问题&#xff1a;最近需要不同磁盘和服务器间大文件&#xff08;一个文件夹几十 T&#xff0c;里面有很多小文件&#xff09;的快速复制&#xff0c;直接通过默认复制卡死。 解决方法&#xff1a;FastCopy&#xff0c;官网&#xff1a;FastCopy &#xff0c;测试速度能能…

vue2旧项目 极速打包实践

背景 公司项目的体量较大&#xff0c;每次serve需要1分钟左右&#xff0c;build需要3分多钟&#xff0c;这是在电脑资源空闲时的速度&#xff0c;如果浏览器开了10几个标签啥的&#xff0c;更慢了。每次改点东西打包发测试环境都很难受。 项目技术栈 // package.json{"d…

百万粉丝都在看的Python上手教程----滚雪球学Python

前言&#xff1a; Hello大家好&#xff0c;我是Dream。 今天为大家带来一本书&#xff1a;《滚雪球学Python》 一起来看看吧~ 《滚雪球学Python》之所以这样命名本书&#xff0c;是希望大家用滚雪球的思维学习编程语言&#xff0c;“滚”的第一遍&#xff0c;从全局掌握Python技…

大话Stable-Diffusion-Webui-动手开发一个简单的stable-diffusion-webui(三)

文章目录 原理文生图API组件的输入TypeScript响应式数据文生图API调用Axios安装使用配置代理文生图API调用调用结果处理图片渲染安装swiper代码仓库原理 上一篇内容中,我们已经将文生图功能的整体UI界面设计好了,这一篇内容将通过调用sd的API,使得我们设计的UI与sd进行联动…

多域名实现单点登录详解

Hi I’m Shendi 多域名实现单点登录详解 简介 在很久以前给自己的网站制作了登录系统&#xff0c;但因为个人备案等原因没有需要用到登录的地方&#xff0c;于是就没有特意去完善这部分功能&#xff0c;仅仅是将用户部分抽取出来作为一个微服务 最近编写一个转换工具&#xf…

unittest教程__认识unittest(1)

unittest是python内置的单元测试框架&#xff0c;具备编写用例、组织用例、执行用例、输出报告等自动化框架的条件。 使用unittest前需要了解该框架的五个概念: 即test case&#xff0c;test suite&#xff0c;test loader&#xff0c;test runner&#xff0c;test fixture。 …

【多线程】锁策略、CAS、Synchronized

目录 常见的锁策略 乐观锁 vs 悲观锁 悲观锁: 乐观锁&#xff1a; 读写锁 重量级锁 vs 轻量级锁 自旋锁&#xff08;Spin Lock&#xff09; 公平锁 vs 非公平锁 可重入锁 vs 不可重入锁 CAS 什么是 CAS CAS 是怎么实现的 CAS 有哪些应用 1) 实现原子类 2) 实现自…

从0到1使用NodeJS编写后端接口的实战案例(仅供参考)

目录 一、项目简介 1、使用技术 2、实现的主要功能 3、项目结构 二、开发环境准备 1、安装node.js 2、安装 MYSQL 数据库 3、安装 node.js 的 mysql 驱动 4、安装 Express 框架 5、Node 格式化时间模块Silly-datetime 6、安装 nodemon 三、后端代码 1、入口文件 —…

帝国cms城市分站系统开发:首页友情链接和分站友情链接分开调用

第一步&#xff1a;phome_enewslink 增加myarea字段 字段类型&#xff1a;int&#xff0c;长度6&#xff0c;非null字段&#xff0c;默认值0 或者在帝国cms后台执行 sql语句&#xff1a; alter table [!db.pre!]enewslink add myarea int(6) not null; 第二步&#xff1a;修…

二次封装NavLink(React实现)

实现思路&#xff1a; 1、定义一个普通组件 2、普通组件内使用NavLink 3、传递参数给定义的普通组件并实现效果 代码实现&#xff1a; App.jsx import React, { Component } from "react"; import About from "../src/Pages/About"; import Home fro…

Vivado全版本下载分享

Vivado是由Xilinx公司开发的一款用于FPGA设计和开发的综合设计环境。它包括了高层次综合&#xff08;HLS&#xff09;、逻辑设计、约束管理、IP核管理、仿真、综合、实现和调试等功能&#xff0c;支持面向最新FPGA器件的设计。 这里分享一下Vivado的电脑安装配置推荐&#xff…