Rocky Linux 9 安裝podman
dnf install podman container-tools
![](https://i0.wp.com/kafeiou.pw/wp-content/uploads/2022/10/image-25.png?resize=651%2C147&ssl=1)
讓系統自動啟用podman
systemctl enable podman systemctl enable podman-restart
![](https://i0.wp.com/kafeiou.pw/wp-content/uploads/2022/10/image-26.png?resize=860%2C78&ssl=1)
修改預設儲存路徑(預設是”/var/lib/containers/storage”)
mkdir -p /podman/storage
![](https://i0.wp.com/kafeiou.pw/wp-content/uploads/2022/10/image-27.png?resize=619%2C74&ssl=1)
vi /etc/containers/storage.conf
![](https://i0.wp.com/kafeiou.pw/wp-content/uploads/2022/10/image-32.png?resize=581%2C138&ssl=1)
讓selinux開放使用
semanage fcontext -a -e /var/lib/containers/storage /podman/storage
restorecon -R -v /podman/storage/
![](https://i0.wp.com/kafeiou.pw/wp-content/uploads/2022/10/image-30.png?resize=860%2C154&ssl=1)
將新的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
![](https://i0.wp.com/kafeiou.pw/wp-content/uploads/2022/10/image-33.png?resize=356%2C370&ssl=1)
Pingback: Rocky Linux podman 更改storage注意事項 - 咖啡偶-IT日常
Pingback: Podman容器備份 - 咖啡偶-IT日常