12.3 配置 Podman
安装 Podman
# pkg install podman-suite# cd /usr/ports/sysutils/podman-suite/
# make install clean# pkg info -D podman
podman-5.3.2_2:
On install: # 安装时:
The FreeBSD port of the Podman container engine is experimental and should be
used for evaluation and testing purposes only.
# Podman 容器引擎的 FreeBSD 移植版本是实验性的,仅供评估和测试使用。
$ sudo podman run --rm quay.io/dougrabson/hello
Podman can restart containers after a host is rebooted. To enable this, use:
# Podman 可以在主机重启后自动重启容器。要启用此功能,请执行以下命令:
$ sudo sysrc podman_enable=YES
and start the container with a restart policy:
# 并使用重启策略启动容器:
$ sudo podman run -d --restart=always myimage
It is possible to run many Linux container images using FreeBSD's Linux emulation:
# 可以通过 FreeBSD 的 Linux 仿真功能运行多数 Linux 容器镜像:
$ sudo sysrc linux_enable=YES
$ sudo service linux start
$ sudo podman run --rm --os=linux alpine cat /etc/os-release | head -1
NAME="Alpine Linux"
On upgrade from podman<4.7.1: # 当从版本小于 4.7.1 的 Podman 进行升级时:
In Podman-4.7.0 and later, registry authentication creds moved from
/run/containers/0/auth.json to /root/.config/containers/auth.json. Either move
the file to the new location or just re-authenticate to the required registries.
# 从 Podman 4.7.0 及更高版本起,注册表认证凭据已从
# /run/containers/0/auth.json 移动到 /root/.config/containers/auth.json。
# 用户可以将该文件移动到新位置,或重新登录所需的镜像注册表配置 fstab
配置网络
创建 ZFS 存储池
启动服务
测试 Ubuntu 镜像
测试 FreeBSD 维护者打包的 nginx 容器
更多用法
拉取 FreeBSD
参考文献
最后更新于