jmservera/aithena/bind-mount-permissions
Claude Code and agent skill by jmservera/aithena
- community
Checking that the SKILL.md file is still in the repository.
Correctly set host directory ownership for Docker bind-mount volumes to avoid permission failures
Install
npx vskill@latest install jmservera/aithena/bind-mount-permissionsSKILL.md
The same SKILL.md was published earlier as jmservera/aithena/bind-mount-permissions.
Context
Bind-mount permission mismatches are the #1 recurring infrastructure issue in aithena. The problem: Docker bind mounts use the host filesystem's ownership, ignoring any RUN chown in the Dockerfile. If the host directory is owned by root:root but the container process runs as a non-root user, the process can't write and crashes.
This has caused failures in:
- Solr data volumes (UID 8983)
- Auth DB directory (UID 1000)
- Collections DB directory (UID 1000)
- RabbitMQ Mnesia data (UID 100)
Pattern: Match Host UID to Container UID
Step 1: Identify the Container User's UID
| Service | Container User | UID | Volume Path | |
|---|---|---|---|---|
| Solr (solr1/2/3) | solr | 8983 | /var/solr/data | |
| Redis | redis | 999 | /data | |
| RabbitMQ | rabbitmq | 100 | /var/lib/rabbitmq | |
| nginx | nginx | 101 | /etc/nginx/ (read-only) | |
| Python services (app) | app | 1000 | /data/auth, /data/collections |
How to find UID when unknown:
Step 2: Set Host Directory Ownership
Step 3: Verify Before Starting Containers
Named Volumes vs Bind Mounts
| Named Volumes | Bind Mounts | ||
|---|---|---|---|
| Ownership | Docker initializes from image layer | Host filesystem ownership | |
RUN chown | ✅ Respected | ❌ Ignored | |
| Portability | ✅ Works anywhere | ❌ Requires host setup | |
| Use case | Stateless data, caches | Persistent data that survives docker volume rm |
Rule: If you must use bind mounts for persistence, the installer/setup script must create directories with correct UIDs.
Anti-Patterns
- Don't rely on Dockerfile `RUN chown` for bind-mounted paths — it only applies to the image layer
- Don't use `chmod 777` — it "works" but violates least-privilege and masks real ownership issues
- Don't forget to re-chown after `rm -rf volumes/` — recreating directories defaults to the current user's UID
- Don't assume `docker compose down -v` clears bind-mount dirs — it only removes named volumes; bind-mount directories persist
Installer Integration
Any setup script (installer/setupdev.sh, installer/setup.sh) that creates bind-mount directories must:
Diagnostic Checklist
When a container crashes with permission errors:
- Check container logs:
docker compose logs <service> | grep -i "permission\|denied\|unable to open" - Check host directory ownership:
ls -lan <host-path> - Compare UID with container user:
docker inspect <container> --format '{{.Config.User}}' - Fix ownership:
sudo chown -R <uid>:<uid> <host-path> - Restart:
docker compose restart <service>
References
docker-compose.yml— volume mount definitionsinstaller/setupdev.sh— dev environment setup- Skill
docker-compose-operations— broader container lifecycle - Brett's history: Auth DB UID 1000 failure, Solr UID 8983 failure (recurring)
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.squad/skills/bind-mount-permissions/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/jmservera/aithena/bind-mount-permissions)