Rocky Linux 9 安裝podman
dnf install podman container-tools
讓系統自動啟用podman
systemctl enable podman systemctl enable podman-restart
修改預設儲存路徑(預設是”/var/lib/containers/storage”)
mkdir -p /podman/storage
vi /etc/containers/storage.conf
讓selinux開放使用
semanage fcontext -a -e /var/lib/containers/storage /podman/storage
restorecon -R -v /podman/storage/
將新的podman storage綁定到原本的/var/lib/container
mount -o bind /podman/storage/ /var/lib/containers #上面指令綁定,若確認成功,改成開機就綁定 vi /etc/fstab /podman/storage/ /var/lib/containers bind bind 0 0
重開機,或下指令讓podman 跑起來
systemctl start podman
查看修改的路徑是否生效
podman info