Skip to content

fix(deploy): add :Z SELinux labels to bind mounts in compose files#3326

Merged
Wei-Shaw merged 1 commit into
Wei-Shaw:mainfrom
tairan:fix/selinux-bind-mount-labels
Jun 21, 2026
Merged

fix(deploy): add :Z SELinux labels to bind mounts in compose files#3326
Wei-Shaw merged 1 commit into
Wei-Shaw:mainfrom
tairan:fix/selinux-bind-mount-labels

Conversation

@tairan

@tairan tairan commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

see description

@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA. ✅
Posted by the CLA Assistant Lite bot.

@tairan tairan closed this Jun 17, 2026
@tairan tairan reopened this Jun 17, 2026
@tairan

tairan commented Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

Add the :Z (private unshared) SELinux label to all bind-mounted
directories in docker-compose.local.yml and docker-compose.dev.yml.

On systems with SELinux in Enforcing mode (e.g. Fedora, RHEL, CentOS),
containers using bind mounts are denied access to host directories
because the default 'user_home_t' context is not accessible to
container processes. The :Z label tells the container runtime to
relabel the mount point with 'container_file_t' so the container
can read/write it.

Named volumes in docker-compose.yml are not affected because the
runtime already handles their labels automatically.

Fixes permission-denied errors on:
- ./data:/app/data
- ./postgres_data:/var/lib/postgresql/data
- ./redis_data:/data
@tairan tairan force-pushed the fix/selinux-bind-mount-labels branch from 2f0c36a to 3164036 Compare June 17, 2026 05:03
github-actions Bot added a commit that referenced this pull request Jun 17, 2026
@Wei-Shaw Wei-Shaw merged commit 8105846 into Wei-Shaw:main Jun 21, 2026
2 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants