OpenHands / OpenHands/software-agent-sdk
Dockerfile best practice: add --no-install-recommends to apt-get install commands in agent-server Dockerfile
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.1k
- Forks
- 539
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 137
Description
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
- Both
apt-get installcommands in the agent-server Dockerfile use--no-install-recommends - Docker image still builds and functions correctly
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open openhands-agent-server/openhands/agent_server/docker/Dockerfile and inspect the two apt-get install commands near lines 380 and 419. Add the requested flag to both, then build the agent-server Docker image to confirm it still builds and functions correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker
- Domain
- devops, infrastructure
- Issue type
- Refactor
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 92/100