podman系列之ubuntu下podman环境搭建

文章目录

  1. 1. Linux环境信息
  2. 2. 安装podman
  3. 3. 设置国内镜像源
  4. 4. 开机自己podman
  5. 5. 验证安装版本

Linux环境信息

1
2
3
4
5
6
7
8
9
10
11
12
13
wujianjun@wujianjun-work:~$ cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.3 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.3 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

安装podman

1
2
3
4
5
wujianjun@wujianjun-work:~$ echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04/ /" | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
wujianjun@wujianjun-work:~$ curl -L "https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04/Release.key" | sudo apt-key add -
wujianjun@wujianjun-work:~$ sudo apt update
wujianjun@wujianjun-work:~$ sudo apt -y upgrade
wujianjun@wujianjun-work:~$ sudo apt -y install podman

速度有点慢。。。

设置国内镜像源

由于访问速度慢,可为默认的docker.io添加加速镜像(如果后续自己搭建私服,可将镜像地址设置为私服,则每次pull时会将镜像在私服上保存一份)。
详细配置如下:

1
2
3
4
5
6
7
8
wujianjun@wujianjun-work:~$ vi /etc/containers/registries.conf 后面增加
`
[[registry]]
prefix = "docker.io" #需要加速的镜像地址
location = "hub-mirror.c.163.com" #加速器地址,可以为私服地址
insecure = true #支持加速器地址使用http进行访问
`
wujianjun@wujianjun-work:~$ sudo systemctl restart podman

开机自己podman

1
wujianjun@wujianjun-work:~$ sudo systemctl start podman

验证安装版本

1
2
3
4
5
6
7
wujianjun@wujianjun-work:~$ podman version
Version: 3.2.3
API Version: 3.2.3
Go Version: go1.15.2
Built: Thu Jan 1 00:00:00 1970
OS/Arch: linux/amd64


观点仅代表自己,期待你的留言。