mirror of
https://github.com/KeygraphHQ/shannon.git
synced 2026-02-12 09:12:50 +00:00
fix: Add Linux support for Docker volume permissions
This commit is contained in:
16
Dockerfile
16
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"]
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user