Podman container storage경로 변경

SELinux가 비활성화 되어있는 경우 단순히 /etc/containers/storage.conf 에서 경로만 변경해주면 됩니다.

기본값은 아래와 같습니다. 해당 /var/lib/containers/storage 경로를 변경하고자 한다면

# Primary Read/Write location of container storage
graphroot = "/var/lib/containers/storage"

아래와 같이 /mnt/mystorage/virtual/storage 경로로 변경합니다.

# Primary Read/Write location of container storage
graphroot = "/mnt/mystorage/virtual/storage"

설정 내용을 확인합니다.

[root@lsrv1 mystorage]# podman info

SELinux를 사용하는 경우 해당 경로에 SELinux Tagging을 진행해야 합니다.

[root@lsrv1 mystorage]# semanage fcontext -a -e /var/lib/containers /mnt/mystorage/virtual/storage
[root@lsrv1 mystorage]# restorecon -Rv /mnt/mystorage/virtual/storage
restorecon reset /mnt/mystorage/virtual/storage context unconfined_u:object_r:mnt_t:s0->unconfined_u:object_r:container_var_lib_t:s0
로그인하면 댓글을 남길 수 있습니다.
  • podman_container_storage경로_변경.txt
  • 마지막으로 수정됨: 2023/12/18 06:51
  • 저자 koov