Context
The Dockerfile at openhands-agent-server/openhands/agent_server/docker/Dockerfile has two apt-get install commands that do not use the --no-install-recommends flag:
- Docker Engine install (line ~380):
apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
- GitHub CLI install (line ~419):
apt-get install -y gh
Best practice
It is a Docker best practice to use --no-install-recommends with apt-get install to avoid pulling in unnecessary recommended packages. This keeps the image lean and reduces unnecessary bloat.
Suggested change
Add --no-install-recommends to both apt-get install commands:
# Docker Engine
apt-get install -y --no-install-recommends docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
# GitHub CLI
apt-get install -y --no-install-recommends gh
Acceptance criteria
OpenHands AI triage
The following comments and acceptance criteria were added by the OpenHands AI agent.
Triage
This is a narrow Dockerfile hygiene fix. The agent-server Dockerfile at openhands-agent-server/openhands/agent_server/docker/Dockerfile has two apt-get install invocations that omit --no-install-recommends (Docker Engine: apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin; GitHub CLI: apt-get install -y gh), while the other two apt-get install invocations in the same file already pass the flag. Adding it drops apt's recommended-but-unneeded dependencies and shrinks the image without changing the requested packages.
Scope: add --no-install-recommends to exactly those two commands in that Dockerfile. Non-goals: no change to package names, versions, repositories, or pinning; no other Dockerfile restructuring; no edits to examples/02_remote_agent_server/06_custom_tool/Dockerfile; no changes for non-apt package managers (microdnf/dnf/yum); no behavior change beyond which packages apt installs.
Verification note: this is a packaging change, so a mocked or unit test cannot validate it. Evidence must come from a real image build plus smoke-running the installed docker and gh executables in the built image (or from the existing agent-server image-build CI job). Two open PRs already implement this (#5070, #5192); whichever is merged should satisfy these criteria.
Desired Behavior
The agent-server Docker image installs the Docker Engine packages and the GitHub CLI without apt's recommended dependencies, while still providing working docker / docker compose and gh executables, consistent with the other apt-get install invocations in the same Dockerfile.
Acceptance Criteria
Context
The Dockerfile at
openhands-agent-server/openhands/agent_server/docker/Dockerfilehas twoapt-get installcommands that do not use the--no-install-recommendsflag:apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-pluginapt-get install -y ghBest practice
It is a Docker best practice to use
--no-install-recommendswithapt-get installto avoid pulling in unnecessary recommended packages. This keeps the image lean and reduces unnecessary bloat.Suggested change
Add
--no-install-recommendsto bothapt-get installcommands:Acceptance criteria
apt-get installcommands in the agent-server Dockerfile use--no-install-recommendsOpenHands AI triage
The following comments and acceptance criteria were added by the OpenHands AI agent.
Triage
This is a narrow Dockerfile hygiene fix. The agent-server Dockerfile at
openhands-agent-server/openhands/agent_server/docker/Dockerfilehas twoapt-get installinvocations that omit--no-install-recommends(Docker Engine:apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin; GitHub CLI:apt-get install -y gh), while the other twoapt-get installinvocations in the same file already pass the flag. Adding it drops apt's recommended-but-unneeded dependencies and shrinks the image without changing the requested packages.Scope: add
--no-install-recommendsto exactly those two commands in that Dockerfile. Non-goals: no change to package names, versions, repositories, or pinning; no other Dockerfile restructuring; no edits toexamples/02_remote_agent_server/06_custom_tool/Dockerfile; no changes for non-apt package managers (microdnf/dnf/yum); no behavior change beyond which packages apt installs.Verification note: this is a packaging change, so a mocked or unit test cannot validate it. Evidence must come from a real image build plus smoke-running the installed
dockerandghexecutables in the built image (or from the existing agent-server image-build CI job). Two open PRs already implement this (#5070, #5192); whichever is merged should satisfy these criteria.Desired Behavior
The agent-server Docker image installs the Docker Engine packages and the GitHub CLI without apt's recommended dependencies, while still providing working
docker/docker composeandghexecutables, consistent with the otherapt-get installinvocations in the same Dockerfile.Acceptance Criteria
openhands-agent-server/openhands/agent_server/docker/Dockerfilereadsapt-get install -y --no-install-recommends docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin, with the package list unchanged.apt-get install -y --no-install-recommends gh.apt-get installinvocation remaining in that Dockerfile passes--no-install-recommends, and the diff is limited to adding the flag to those two commands (no other Dockerfile line changes).docker --version,docker compose version, andgh --versionall succeed, confirming the recommended-package removal did not drop a runtime requirement.