Docker Swarm exec, logs, port-forward
翻译准备中
取自仓库 README
正在加载完整 README。
查看完整 README ↗docker exec, logs and port-forward for any container in a Docker Swarm — from one terminal, without SSH to the node that runs it.
🌐 Website and full documentation: swarm-exec.cloud-surfers.net — docs in English, Deutsch, Español, Français and Polski · release notes
Docker Swarm schedules tasks from the manager, but a container's shell, its logs, a port nobody published and the volume on its disk live on one node — and the manager API reaches none of them. swarmexec (also written swarm-exec) puts a small agent on every node and asks it directly.
swarmexec exec web -- sh opens a shell in the task, on whatever node it runs. Targets →stack deploy. stack diff →swarmexec mcp lets Claude Code and friends read status, logs and stack diffs of the services you opt in by label; read-only, labels hidden from the assistant. mcp →Apache-2.0, self-hosted, no telemetry, no node limit. Docker Engine 19.03 or newer.
curl -fsSL https://swarm-exec.cloud-surfers.net/install.sh | sh # Linux, macOS — verifies the checksum
brew install ekrotov/swarmexec/swarmexec # macOS, Linux
scoop bucket add swarmexec https://github.com/ekrotov/scoop-swarmexec
scoop install swarmexec # Windows
Or take a binary from the latest release. Install →
swarmexec --context prod init # deploy the agent to every node, write the client config
swarmexec ps # what you can exec into, and on which node
swarmexec exec web -- sh # a shell in a task of the service "web"
swarmexec ui # the terminal UI
your terminal ──gRPC (mTLS or bound secret)──> agent on node N ──docker.sock──> container
│
└── Docker manager API: which node runs the task, and its container id
The agent runs as a global Swarm service, one task per node, with the node's Docker socket mounted. The client asks the manager where the target runs and connects straight to that node's agent — there is no mesh between agents. How it works →
The full documentation lives at swarm-exec.cloud-surfers.net/docs: configuration · Docker contexts and SSH · all commands · the TUI · monitoring · policy file · exit codes
In this repository:
docs/manual-setup.md — deploying the agent by hand with your own CA, the agent and client flags, troubleshooting, production notes.docs/related-work.md — how swarmexec compares with d4s, swarmcli, Portainer, Swarmpit, Komodo and the older swarm-exec scripts.DEVELOPMENT.md — building, tests, the documentation translations, the release pipeline.CONTRACT.md and proto/swarmexec.proto — the wire protocol; agent/README.md, client/README.md — the two components' internals.The agent image is public on Docker Hub as logleio/swarmexec-agent.
Source: gitlab.logle.io/cs-public/swarm-remote-exec, mirrored to github.com/ekrotov/swarmexec.
swarmexec is open source under the Apache License 2.0.
Copyright 2026 Cloud Surfers GmbH.
Contributions are welcome under the same license and require a DCO sign-off
(git commit -s) — see CONTRIBUTING.md.
If you redistribute swarmexec — as source, as a binary, or inside a derivative
work — the license requires you to keep the LICENSE and
NOTICE files with it, so the attribution to this project travels
along. Modified files must be marked as changed.