[PODMAN] Rootless Mode: Start Container แล้วเจอ Permission Denied

พอดีที่เครื่องทดสอบในบริษัท แล้วเจอ Error: unable to start container .... Permission denied

[invsbch@invsuatapp01 ~]$ podman start wmsl-app-service
Error: unable to start container "a5227f81d3a562bf5a53c31044b434d27a0cdl8381bb7b98e495da6c8ldeaebd" ; 
relabel  failed "/BNZApp1/tmp": open /BNZApp1/tmp/oscapinstall: Permission denied

สาเหตุ

  • Volume ที่ Mount ไว้ สำหรับ Rootless Container มีไฟล์ หรือ Folder ที่ Owner ไม่เหมือนกับ User ที่เป็น Rootless Container ในเคสนี้ invsbch เป็น user สำหรับดูแล Rootless Container แต่ /BNZApp1/tmp/oscapinstall มี Owner เป็น root ตัว Podman เลยไม่ยอมให้ Start Container ครับ
  • อ๋อ อีกเรื่อง ตอน Mount Volume เข้า Podman จะถูก SELinux ตรวจสอบด้วยครับ ซึ่งต่างกับ Docker ที่ไม่สามารถทำในส่วนนี้ได้ครับ

การแก้ไข

  • ตรวจสอบไฟล์สิทธิของไฟล์ และ Folder ที่ให้ตรงกับ User ที่จัดการ Rootless Container ครับ และจัดการแก้ไข หรือ ลบทิ้งครับ

Discover more from naiwaen@DebuggingSoft

Subscribe to get the latest posts to your email.