From aeae1e4377148116f0e37e563bece9d4cb8aff0b Mon Sep 17 00:00:00 2001 From: Lucas Berger Date: Thu, 29 Jan 2026 08:22:32 -0500 Subject: [PATCH] docs(02): research phase domain with Context7 Phase 02: Docker Integration - Docker Engine API endpoints documented (Context7 /docker/docs) - n8n Execute Command and Code node patterns (Context7 /n8n-io/n8n-docs) - Custom Dockerfile needed for curl in n8n container - Fuzzy matching and response formatting patterns --- .../02-docker-integration/02-RESEARCH.md | 29 +++++++++---------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/.planning/phases/02-docker-integration/02-RESEARCH.md b/.planning/phases/02-docker-integration/02-RESEARCH.md index 3995b64..5277472 100644 --- a/.planning/phases/02-docker-integration/02-RESEARCH.md +++ b/.planning/phases/02-docker-integration/02-RESEARCH.md @@ -598,30 +598,27 @@ Things that couldn't be fully resolved: ## Sources -### Primary (HIGH confidence) -- [Docker Engine API Official Documentation](https://docs.docker.com/reference/api/engine/) - API reference -- [Docker Engine API Examples](https://docs.docker.com/reference/api/engine/sdk/examples/) - Official usage examples -- [Docker inspect CLI documentation](https://docs.docker.com/reference/cli/docker/inspect/) - Container data structure -- [Docker stats CLI documentation](https://docs.docker.com/reference/cli/docker/container/stats/) - Resource metrics -- [n8n Docker documentation](https://docs.n8n.io/hosting/installation/docker/) - n8n Docker setup -- [n8n Docker Compose documentation](https://docs.n8n.io/hosting/installation/server-setups/docker-compose/) - Deployment examples -- [n8n Code node documentation](https://docs.n8n.io/code/code-node/) - JavaScript execution -- [n8n Execute Command documentation](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.executecommand/) - Shell command execution +### Primary (HIGH confidence) — Context7 MCP + +**Docker API** (`/docker/docs`): +- `GET /containers/json` — List containers with filtering (all, status, before, limit) +- `GET /containers/(id)/stats` — Resource usage (memory_stats, cpu_stats, network) +- Container response schema: Id, Names, Image, State, Status, Ports, NetworkSettings +- curl unix socket pattern: `curl --unix-socket /var/run/docker.sock http://localhost/v1.xx/containers/json` + +**n8n Documentation** (`/n8n-io/n8n-docs`): +- Execute Command node — Disabled by default in n8n 2.0+, runs in container not host +- Custom Dockerfile needed for curl: `FROM n8nio/n8n; USER root; RUN apk add curl; USER node` +- Code node external modules: `NODE_FUNCTION_ALLOW_EXTERNAL=moment,uuid` environment variable +- Built-in modules: `NODE_FUNCTION_ALLOW_BUILTIN=crypto` for Node.js builtins ### Secondary (MEDIUM confidence) -- [Using curl with Docker Unix socket](https://sleeplessbeastie.eu/2021/12/13/how-to-query-docker-socket-using-curl/) - Practical curl examples -- [Docker Engine API container info guide](https://www.baeldung.com/ops/docker-engine-api-container-info) - Comprehensive guide verified with official docs -- [Docker stats in JSON format](https://kylewbanks.com/blog/docker-stats-memory-cpu-in-json-format) - Stats parsing examples -- [n8n Execute Command tutorial](https://logicworkflow.com/nodes/execute-command-node/) - Usage patterns - [Fuse.js official documentation](https://www.fusejs.io/) - Fuzzy matching library - [fast-fuzzy npm package](https://www.npmjs.com/package/fast-fuzzy) - Lightweight alternative -- [n8n modules in Code node](https://docs.n8n.io/hosting/configuration/configuration-examples/modules-in-code-node/) - External package setup ### Tertiary (LOW confidence) -- [n8n community: Docker commands from n8n](https://community.n8n.io/t/can-i-run-docker-command-from-n8n/19659) - Community discussion, verify approaches - [Docker socket security considerations](https://0xn3va.gitbook.io/cheat-sheets/container/escaping/exposed-docker-socket) - Security implications - [Container escape mitigation](https://www.startupdefense.io/cyberattacks/docker-escape) - Security best practices -- [Docker container naming conventions](https://devtodevops.com/blog/docker-container-naming-convention/) - Community practices ## Metadata