Skip to content

fix(docker): make image entrypoint command-agnostic - #155

Merged
digizeph merged 1 commit into
mainfrom
fix/docker-entrypoint
Sep 10, 2026
Merged

digizeph merged 1 commit into
mainfrom
fix/docker-entrypoint

Conversation

@digizeph

Copy link
Copy Markdown
Member

The image entrypoint hard-coded monocle server (ENTRYPOINT ["monocle", "server"]), so docker run IMAGE <command> appended its arguments to the server invocation and failed — docker run bgpkit/monocle watch ... returned error: unexpected argument 'watch' found — even though the README documented direct subcommand usage.

The entrypoint is now monocle with server as the default CMD, so defaults are unchanged: a bare docker run and docker-compose.yml (which sets no command:) still start the server, while any subcommand runs directly.

$ docker run --rm bgpkit/monocle:latest inspect 13335
$ docker run --rm bgpkit/monocle:latest watch --host rrc00 --origin-asn 13335
$ docker run --rm bgpkit/monocle:latest parse --help

The README Docker section documents the pass-through usage and notes that server is the default command; the changelog entry is under Unreleased / Bug Fixes.

Validation

Image built locally and exercised: --help, watch --help, and parse --help print the CLI's own output; a bare docker run starts the server with /health responding; a 20-second live watch against rrc00 connects and receives its subscription acknowledgement.

The image entrypoint hard-coded `monocle server`, so `docker run IMAGE
<command>` appended the arguments to the server invocation and failed
(`error: unexpected argument 'watch' found`) even though the README
documented direct subcommand usage.

Set ENTRYPOINT to `monocle` and move the default command to CMD, so a bare
`docker run` and docker-compose (which sets no `command:`) still start the
server while every subcommand is reachable directly.
Copilot AI balanced review requested due to automatic review settings September 10, 2026 23:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The changes correctly apply Docker entrypoint semantics while preserving existing default server behavior.

Pull request overview

Makes the Docker image entrypoint command-agnostic while preserving server mode as the default.

Changes:

  • Sets monocle as ENTRYPOINT and server as CMD.
  • Documents direct Docker subcommand usage.
  • Records the fix in the changelog.
File summaries
File Description
Dockerfile Separates executable entrypoint from the default command.
README.md Updates Docker usage examples and default behavior.
CHANGELOG.md Documents the entrypoint fix.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@digizeph
digizeph merged commit ea9a0ef into main Sep 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants