From b54d0fcc9b9468e21c33c68bebbaa4857523811b Mon Sep 17 00:00:00 2001 From: Khaushik-keygraph Date: Sat, 20 Dec 2025 23:02:24 +0530 Subject: [PATCH] fix: Add Linux support for Docker volume permissions --- Dockerfile | 16 +++++++++++----- README.md | 6 ++++++ 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 32a3859..c8c353a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -121,12 +121,15 @@ RUN npm ci --only=production && \ COPY . . # Create directories for session data and ensure proper permissions - -RUN mkdir -p /app/sessions /app/deliverables /app/repos && \ - chown -R pentest:pentest /app /app/repos && \ +RUN mkdir -p /app/sessions /app/deliverables /app/repos /app/configs && \ + mkdir -p /tmp/.cache /tmp/.config /tmp/.npm && \ + chmod 777 /app && \ + chmod 777 /tmp/.cache && \ + chmod 777 /tmp/.config && \ + chmod 777 /tmp/.npm && \ + chown -R pentest:pentest /app && \ chmod +x /app/shannon.mjs - # Switch to non-root user USER pentest @@ -139,7 +142,10 @@ ENV PATH="/usr/local/bin:$PATH" ENV SHANNON_DOCKER=true ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 ENV PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH=/usr/bin/chromium-browser - +ENV npm_config_cache=/tmp/.npm +ENV HOME=/tmp +ENV XDG_CACHE_HOME=/tmp/.cache +ENV XDG_CONFIG_HOME=/tmp/.config # Set entrypoint ENTRYPOINT ["./shannon.mjs"] \ No newline at end of file diff --git a/README.md b/README.md index 57029d5..a965c93 100644 --- a/README.md +++ b/README.md @@ -192,6 +192,12 @@ docker run --rm -it \ --config /app/configs/example-config.yaml ``` +#### Platform-Specific Instructions + +**For Linux (Native Docker):** + +Add the `--user $(id -u):$(id -g)` flag to the Docker commands above to avoid permission issues with volume mounts. Docker Desktop on macOS and Windows handles this automatically, but native Linux Docker requires explicit user mapping. + **Network Capabilities:** - `--cap-add=NET_RAW` - Enables advanced port scanning with nmap