Skip to content

How to allow a container to access files of some host group? Permission problem. #24379

Closed Answered by parametalol
parametalol asked this question in Q&A
Discussion options

You must be logged in to vote

Solution

  1. Add another mapping to /etc/subgid for the extra group:

     ...
     photoprism:1004:1
     photoprism:524288:65536
    
  2. Run the container with:

     --group-add 1004             // add the root user to group 1004 inside the container
     --gidmap '+g1004:@1004'      // add mapping of the container group 1004 to the host 1004 group
     --security-opt label=disable // disable SELinux labeling for the container :(
    

    Same but for the docker-compose file:

    services:
      photoprism:
        security_opt:
          - label:disable
        group_add:
          - 1004
        x-podman.gidmap:
          - "+g1004:@1004"

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by parametalol
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant