jmservera/aithena/bind-mount-permissions

Claude Code and agent skill by jmservera/aithena

Trust tier 3
  • community
Source check pending

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-permissions

SKILL.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
ServiceContainer UserUIDVolume Path
Solr (solr1/2/3)solr8983/var/solr/data
Redisredis999/data
RabbitMQrabbitmq100/var/lib/rabbitmq
nginxnginx101/etc/nginx/ (read-only)
Python services (app)app1000/data/auth, /data/collections

How to find UID when unknown:

bash
docker image inspect <image> | grep -i user
# or
docker run --rm <image> id
Step 2: Set Host Directory Ownership
bash
# Before docker compose up:
sudo chown -R 8983:8983 ./volumes/solr-data{1,2,3}
sudo chown -R 1000:1000 ./volumes/auth-db ./volumes/collections
sudo chown -R 100:100 ./volumes/rabbitmq-data
Step 3: Verify Before Starting Containers
bash
ls -lan ./volumes/ | awk '{print $3, $4, $NF}'
# Expected: 8983 8983 solr-data1, 1000 1000 auth-db, etc.

Named Volumes vs Bind Mounts

Named VolumesBind Mounts
OwnershipDocker initializes from image layerHost filesystem ownership
RUN chown✅ Respected❌ Ignored
Portability✅ Works anywhere❌ Requires host setup
Use caseStateless data, cachesPersistent 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:

bash
# Create with correct ownership
mkdir -p "$VOLUMES_DIR/solr-data"{1,2,3}
sudo chown -R 8983:8983 "$VOLUMES_DIR/solr-data"{1,2,3}
mkdir -p "$AUTH_DB_DIR"
sudo chown -R 1000:1000 "$AUTH_DB_DIR"

Diagnostic Checklist

When a container crashes with permission errors:

  1. Check container logs: docker compose logs <service> | grep -i "permission\|denied\|unable to open"
  2. Check host directory ownership: ls -lan <host-path>
  3. Compare UID with container user: docker inspect <container> --format '{{.Config.User}}'
  4. Fix ownership: sudo chown -R <uid>:<uid> <host-path>
  5. Restart: docker compose restart <service>

References

  • docker-compose.yml — volume mount definitions
  • installer/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

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
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/jmservera/aithena/bind-mount-permissions/badge)](https://verified-skill.com/skills/jmservera/aithena/bind-mount-permissions)

Something wrong with this skill or its page? Tell us.