Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add z permissions option to compose mounts to accommodate SELinux hosts #3276

Closed
sarayourfriend opened this issue Oct 31, 2023 · 0 comments · Fixed by #3455
Closed

Add z permissions option to compose mounts to accommodate SELinux hosts #3276

sarayourfriend opened this issue Oct 31, 2023 · 0 comments · Fixed by #3455
Labels
🤖 aspect: dx Concerns developers' experience with the codebase 🛠 goal: fix Bug fix 🟨 priority: medium Not blocking but should be addressed soon 🧱 stack: mgmt Related to repo management and automations

Comments

@sarayourfriend
Copy link
Contributor

Description

Hosts using SELinux (ex. RHEL based Linux distros like Fedora) need the z option added to bind mounts to configure file permissions for SELinux docker, otherwise things fail on file permissions issues inside the containers. More information about this is here: https://docs.docker.com/storage/bind-mounts/#configure-the-selinux-label

While it's dangerous to indiscriminately use this, because we scope all bind mounts to the repository, it is perfectly safe to add z to all bind mounts. Folks running SELinux will be conscientious enough to check this. As precedent, pre-commit also sets z by default for docker and docker_image hooks.

Fix

Add z to all bind mounts in docker-compose.yml.

Additional context

I've been working around this by adding it temporarily locally and then removing it. The labels only need to be set once, so this has been manageable for the most part, but any time new files are added, I run into the issue again. Having it added in the compose file would make it so I and others using SELinux don't need to hack around this and remember what to do every time we get a confounding file permissions error locally.

@sarayourfriend sarayourfriend added 🟨 priority: medium Not blocking but should be addressed soon 🛠 goal: fix Bug fix 🤖 aspect: dx Concerns developers' experience with the codebase 🧱 stack: mgmt Related to repo management and automations labels Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖 aspect: dx Concerns developers' experience with the codebase 🛠 goal: fix Bug fix 🟨 priority: medium Not blocking but should be addressed soon 🧱 stack: mgmt Related to repo management and automations
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant