Skills2026年4月16日·1 分钟阅读

ctop — Top-Like Interface for Container Metrics

Real-time monitoring dashboard for Docker and runC containers, displaying CPU, memory, network, and I/O metrics in a familiar top-style terminal UI.

Agent 就绪

先审查再安装

这个资产需要先审查。复制的指令会要求 Agent dry-run、列出写入项,确认后再继续。

Needs Confirmation · 64/100策略:需确认
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
ctop Container Monitor
先审查命令
npx -y tokrepo@latest install dcc36ad5-397d-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run,确认写入项后再运行此命令。

TL;DR
ctop is a single Go binary that displays live CPU, memory, and network stats for all running containers.
§01

What it is

ctop is a terminal-based monitoring tool that brings the familiar Unix top experience to Docker and runC containers. It displays live CPU, memory, network I/O, and disk I/O metrics per container in a scrollable table.

ctop targets developers and DevOps engineers who want quick container resource visibility without setting up a full monitoring stack like Prometheus plus Grafana.

§02

How it saves time or tokens

Instead of parsing docker stats output or piping JSON through jq, ctop provides instant visual feedback in a single command. It also lets you start, stop, pause, and remove containers directly from the TUI, eliminating context-switching to a separate terminal window.

§03

How to use

  1. Install ctop:
# macOS
brew install ctop
# Linux
sudo wget https://github.com/bcicen/ctop/releases/download/v0.7.7/ctop-0.7.7-linux-amd64 -O /usr/local/bin/ctop
sudo chmod +x /usr/local/bin/ctop
  1. Run ctop in your terminal. It auto-detects the Docker daemon.
  1. Use arrow keys to select a container and press Enter for detailed sparkline graphs.
§04

Example

# Launch ctop
ctop

# Filter containers by name
ctop -f web

# Sort by CPU usage
# Press 's' inside ctop, then select 'cpu'

# Connect to a remote Docker host
DOCKER_HOST=tcp://remote:2375 ctop
§05

Related on TokRepo

§06

Common pitfalls

  • ctop requires access to the Docker daemon socket. If running as a non-root user, add yourself to the docker group or use sudo.
  • The default refresh interval is 1 second which can cause high CPU on hosts with hundreds of containers. Use the -i flag to increase the interval.
  • ctop does not support Kubernetes pods directly. It monitors containers at the Docker/runC runtime level only.

常见问题

Does ctop work with Podman?+

ctop is designed for Docker and runC container runtimes. Podman compatibility depends on whether the Podman socket is configured to emulate the Docker API. With podman-docker installed and the socket active, ctop can connect.

Can ctop monitor remote Docker hosts?+

Yes. Set the DOCKER_HOST environment variable to point to a remote Docker daemon (e.g., tcp://remote:2375) and ctop will connect to that host instead of the local socket.

What metrics does ctop display?+

ctop shows CPU usage percentage, memory usage and limit, network bytes received and transmitted, and block I/O read and write per container. The detail view adds sparkline history graphs for each metric.

Is ctop a single binary with no dependencies?+

Yes. ctop is compiled as a single Go binary. It has no runtime dependencies beyond access to the Docker daemon socket or runC state directory.

How does ctop compare to docker stats?+

docker stats provides a streaming text table that is hard to sort or filter. ctop adds interactive sorting, filtering, container actions (stop, pause, remove), and sparkline history graphs in a full TUI experience.

引用来源 (3)
  • ctop GitHub— ctop is a top-like interface for container metrics supporting Docker and runC
  • Docker Documentation— Docker container stats API for resource usage monitoring
  • runC GitHub— runC is the OCI container runtime specification

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产