Skip to content

Add shared output volume and symlinks for cross-container data#75

Merged
valITino merged 2 commits intomainfrom
claude/fix-docker-volume-mount-LBj3z
Mar 16, 2026
Merged

Add shared output volume and symlinks for cross-container data#75
valITino merged 2 commits intomainfrom
claude/fix-docker-volume-mount-LBj3z

Conversation

@valITino
Copy link
Copy Markdown
Owner

Summary

This PR enables data sharing between the Kali MCP container and Claude Code container by introducing a shared Docker volume and creating symlinks to support multiple path conventions for accessing output files.

Key Changes

  • Added shared Docker volume (shared-output) to docker-compose.yml for cross-container data exchange
  • Mounted shared volume in Kali MCP service at /root/output to write recon files and tool artifacts
  • Mounted shared volume in Claude Code service at /root/kali-data (read-only) to access Kali outputs
  • Created symlinks in the entrypoint script to bridge path conventions:
    • /root/output/reports/root/reports (pentest reports)
    • /root/output/sessions/root/results (session JSONs)
    • /root/output/screenshots/tmp/screenshots (PoC evidence)
  • Updated help text to document the new shared output directory and symlink mappings

Implementation Details

The symlink creation in the entrypoint script allows skill templates that reference output/reports/, output/sessions/, etc. to resolve correctly within the container's /root WORKDIR, while also supporting direct access to the bind-mounted directories. This provides flexibility for different code paths to access the same underlying data.

The shared volume enables the Kali MCP container to persist reconnaissance data and tool artifacts that Claude Code can then access and utilize in subsequent operations.

https://claude.ai/code/session_01TmNSmHJNnGJoE6hBJRQnwM

claude added 2 commits March 16, 2026 08:27
Reports and evidence written inside the Claude Code container were not
appearing on the host because of two issues:

1. Path mismatch: Skill templates reference "output/reports/" which
   resolves to /root/output/reports/ (WORKDIR is /root), but the bind
   mount target is /root/reports/. Added symlinks in the entrypoint so
   /root/output/reports -> /root/reports, /root/output/sessions ->
   /root/results, and /root/output/screenshots -> /tmp/screenshots.

2. No cross-container data sharing: Kali MCP writes recon artifacts to
   /root/output/ inside its container, which was inaccessible to Claude
   Code and the host. Added a shared-output Docker named volume mounted
   in both kali-mcp (/root/output) and claude-code (/root/kali-data:ro).

https://claude.ai/code/session_01TmNSmHJNnGJoE6hBJRQnwM
- Makefile: add shared-output volume to nuke target for complete cleanup
- Entrypoint: show output/reports/ (the path AI should use) instead of
  internal /root/reports/ paths; clarify kali-data is read-only incoming
- README: update output paths table to use relative path convention,
  document shared-output volume and symlink behavior

https://claude.ai/code/session_01TmNSmHJNnGJoE6hBJRQnwM
@valITino valITino marked this pull request as ready for review March 16, 2026 08:45
@valITino valITino merged commit 6680ba9 into main Mar 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants