#4070: fix(docker): expose moltbot CLI in Docker image
docker
Cluster:
Docker Build Fixes
### What
Fixes the `moltbot` CLI not being available inside Docker containers.
### Why
The Docker image builds successfully, but the `moltbot` command is not exposed
in PATH. pnpm workspace `.bin` shims are not reliable as a Docker entrypoint,
especially when running as a non-root user.
### How
Expose the actual CLI entrypoint (`/app/moltbot.mjs`) via a lightweight wrapper
script at `/usr/local/bin/moltbot`.
### Testing
- docker build
- docker run moltbot moltbot --version
- docker run moltbot moltbot doctor
- docker run moltbot moltbot --help
Fixes #3994
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR updates the Docker image so the `moltbot` CLI is reliably available in `PATH` at runtime. Instead of relying on pnpm workspace `.bin` shims (which can be brittle as an entrypoint and under non-root users), it exposes the real CLI entrypoint (`/app/moltbot.mjs`) via a small wrapper installed at `/usr/local/bin/moltbot`. This fits the repo’s container packaging by making the CLI callable uniformly in `docker run … moltbot …` without depending on pnpm’s runtime layout.
<h3>Confidence Score: 4/5</h3>
- This PR is generally safe to merge; the change is small and localized to Docker runtime behavior.
- Only the Dockerfile is modified to add a wrapper script exposing an existing CLI entrypoint. Risk is limited to container execution paths and user/permission behavior; no application logic changes are introduced.
- Dockerfile (verify wrapper has correct shebang/permissions and works under non-root)
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
**Context used:**
- Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8))
- Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13))
<!-- /greptile_comment -->
Most Similar PRs
#3965: Fix Docker Compose configuration for moltbot deployment
by YoByron · 2026-01-29
84.1%
#3513: fix(docker): add MOLTBOT_STATE_DIR to resolve permission error
by Suksham-sharma · 2026-01-28
84.1%
#4238: Fix/docker migration atomicity
by ricardotrevisan · 2026-01-29
83.1%
#2609: bugfix: Docker build fails on main: .dockerignore excludes required...
by yanquankun · 2026-01-27
81.6%
#3783: Fix/3038 cli name moltbot
by Shuimo03 · 2026-01-29
80.9%
#4695: Fixed the default CLI image to use published GHCR image
by TASMAYU · 2026-01-30
79.5%
#4450: fix bug #4366: Error: Config validation failed: plugins.slots.memor...
by tryagain3 · 2026-01-30
78.6%
#6698: feat: Add CLI wrapper for Docker integration and update documentation
by barshopen · 2026-02-01
78.5%
#17151: fix: add npm link to fix CLI permission denied (exit 127)
by sskyu · 2026-02-15
78.1%
#17916: [ fix ] : correct config directory path during onboarding
by Dijo-404 · 2026-02-16
78.1%