如何在 Ubuntu 22.04 LTS 上安装 Podman
admin
2023-07-31 03:35:22
0

Podman 是一个用于虚拟化应用程序的容器工具。它最初由Red Hat开发,起源于Cri-O项目,该项目开发了一个替代Docker运行时环境的轻量级容器运行时环境。Podman 通过允许您在根和无根模式下运行容器来区别于竞争对手。此外,Podman 不是一个正在运行的服务,这意味着它是守护进程。podman-logopodman-logo

在 Ubuntu 22.04 LTS Jammy Jellyfish 上安装 Podman

第 1 步。首先,通过在终端中运行以下命令,确保所有系统软件包都是最新的。apt

sudo apt update
sudo apt upgrade

第 2 步。在 Ubuntu 22.04 上安装 Podman。

默认情况下,Podman 在 Ubuntu 22.04 基本存储库上可用。现在运行以下命令,将最新版本的 Podman 安装到 Ubuntu 系统中:

sudo apt install podman

现在使用以下命令检查已安装的 Podman 的版本:

podman -v

您还可以使用以下命令查看有关 Podman 的详细信息:

podman info

第 3 步。配置 Podman 注册表。

默认情况下,Podman 注册表未配置为从 Web 下载和安装容器映像,因此我们需要手动执行此操作,以便我们可以使用流行的存储库,例如 Docker.io 和 Fedora:

nano /etc/containers/registries.conf

添加以下行:

[registries.search]
registries=[\"registry.access.redhat.com\", \"registry.fedoraproject.org\", \"docker.io\"]

第 3 步。如何使用 Podman。

就像 Docker 一样,我们可以使用 Podman 命令行搜索图像,但来自上一步中添加的不同存储库。您可以在指定为的注册表中搜索 Podman 映像:

podman search debian

接下来,使用以下命令从互联网上下载最新的 Debian 镜像:

podman pull debian

如果您下载了多个映像,现在想查看系统上有哪些可用映像,我们可以使用给定的命令列出所有映像:

podman images

此外,还可以使用以下命令查看正在运行的容器:

sudo podman ps -a

您可以使用以下命令列出所有 Podman 命令选项:

podman --help

输出:

Manage pods, containers and images

Usage:
  podman [options] [command]

Available Commands:
  attach      Attach to a running container
  auto-update Auto update containers according to their auto-update policy
  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 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
  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
  mount       Mount a working container\'s root filesystem
  network     Manage networks
  pause       Pause all the processes in one or more containers
  play        Play containers, pods or volumes from a structured file
  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
  unmount     Unmounts working container\'s root filesystem
  unpause     Unpause the processes in one or more containers
  unshare     Run a command in a modified user namespace
  untag       Remove a name from a local image
  version     Display the Podman version information
  volume      Manage volumes
  wait        Block on one or more containers

感谢您使用本教程在 Ubuntu 22.04 LTS Jammy Jellyfish 系统上安装 Podman。如需其他帮助或有用信息,我们建议您查看 Podman 网站。

相关内容

热门资讯

Windows 11 和 10... Windows 11/10 文件夹属性中缺少共享选项卡 – 已修复 1.检查共享选项卡是否可用 右键...
Radmin VPN Wind... Radmin VPN 是一款免费且用户友好的软件,旨在牢固地连接计算机以创建一个有凝聚力的虚拟专用网...
如何修复 Steam 内容文件... Steam 内容文件锁定是当您的 Steam 文件无法自行更新时出现的错误。解决此问题的最有效方法之...
事件 ID 7034:如何通过... 点击进入:ChatGPT工具插件导航大全 服务控制管理器 (SCM) 负责管理系统上运行的服务的活动...
Hive OS LOLMine... 目前不清退的交易所推荐: 1、全球第二大交易所OKX欧意 国区邀请链接: https://www.m...
在 Windows 11 中打... 什么是链路状态电源管理? 您可以在系统控制面板的电源选项中看到链接状态电源管理。它是 PCI Exp...
如何在电报Telegram中隐... 点击进入:ChatGPT工具插件导航大全 在Android上的电报中隐藏您的电话号码 您可以通过切换...
如何在 iPhone 14 P... Apple 的 iPhone 14 Pro 是第一款配备 48MP 传感器的 iPhone。所有以前...
在 iCloud 上关闭“查找... 如果您是 Apple 的长期用户,您肯定会遇到过 Find My 应用程序,它本机安装在 iPhon...
Hive OS 部署 PXE ... 目前不清退的交易所推荐: 1、全球第二大交易所OKX欧意 国区邀请链接: https://www.m...