Edit ‘podman’: tambahkan pemecahan masalah tidak dapat mount volume, izin ditolak

This commit is contained in:
nawan 2024-02-16 01:05:41 +07:00 committed by wikimind
parent ec1f85dcaf
commit ed8315b29f
1 changed files with 7 additions and 1 deletions

View File

@ -45,4 +45,10 @@ rootless_networking = "cni"
= Kenapa tidak bisa menggunakan sudo dengan Podman //rootless//?
> All of this still doesn't explain why you cannot use sudo and su with rootless containers. The answer is that sudo and su do not create a login session. There are many historical reasons for this, most stemming from the fact that sudo and su are somewhat irregular (one user becoming another user, instead of a fresh login). See this GitHub issue for details. Given this, rootless Podman cannot be used with sudo and su unless loginctl enable-linger is used to force a persistent user session to be created for the user.
-- [[https://www.redhat.com/sysadmin/sudo-rootless-podman | Why can't I use sudo with rootless Podman?]]
-- [[https://www.redhat.com/sysadmin/sudo-rootless-podman | Why can't I use sudo with rootless Podman?]]
= Tidak bisa //mount// volume ke //rootless container//, izin ditolak
Dari [[https://github.com/containers/podman/blob/main/troubleshooting.md#2-cant-use-volume-mount-get-permission-denied]] disebutkan:
> Labeling systems like SELinux require that proper labels are placed on volume content mounted into a container. Without a label, the security system might prevent the processes running inside the container from using the content. By default, Podman does not change the labels set by the OS.
>
> To change a label in the container context, you can add either of two suffixes :z or :Z to the volume mount. These suffixes tell Podman to relabel file objects on the shared volumes. The z option tells Podman that two containers share the volume content. As a result, Podman labels the content with a shared content label. Shared volume labels allow all containers to read/write content. The Z option tells Podman to label the content with a private unshared label. Only the current container can use a private volume.