Podman 安装

Podman 安装_容器

文章目录

  • ​​Podman 安装​​
  • ​​1. dnf 安装​​
  • ​​2. yum 安装​​
  • ​​3. apt-get 安装​​

1. dnf 安装

第一种方式

sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
dnf update
dnf upgrade
dnf install -y epel-release

dnf 命令详细 请参考 ​​centos 8.2 指南​​与​​Linux Command Dnf 包管理工具​​

$ dnf --showduplicates list podman
Last metadata expiration check: 0:06:19 ago on Fri 18 Nov 2022 10:24:42 AM CST.
Available Packages
podman.x86_64 3.3.1-9.module_el8.5.0+988+b1f0b741 appstream

$ dnf --showduplicates list buildah
Last metadata expiration check: 0:07:03 ago on Fri 18 Nov 2022 10:24:42 AM CST.
Available Packages
buildah.x86_64 1.22.3-2.module_el8.5.0+911+f19012f9 appstream

$ dnf install podman skopeo buildah

第二种方式

sudo dnf config-manager --set-enabled powertools
sudo dnf -y update
$ sudo dnf module list | grep container-tools
container-tools rhel8 [d][e] common [d] Most recent (rolling) versions of podman, buildah, skopeo, runc, conmon, runc, conmon, CRIU, Udica, etc as well as dependencies such as container-selinux built and tested together, and updated as frequently as every 12 weeks.

$ sudo dnf install -y @container-tools

$ podman version
Client: Podman Engine
Version: 4.0.2
API Version: 4.0.2
Go Version: go1.17.7

Built: Sun May 15 19:45:11 2022
OS/Arch: linux/amd64

配置​​podman​​​别名为​​docker​

$ vim  /root/.bashrc
alias docker='podman'
$ source /root/.bashrc
$ docker info

2. yum 安装

yum update
yum install epel-release
yum install -y podman

3. apt-get 安装

sudo sh -c "echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/testing/x${NAME}_${VERSION_ID}/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:testing.list"
wget -nv https://download.opensuse.org/repositories/devel:kubic:libcontainers:testing/x${NAME}_${VERSION_ID}/Release.key -O Release.key
sudo apt-key add - < Release.key
sudo apt-get update -qq
sudo apt-get -qq -y install podman
$ sudo apt-get install podman