OpenHands / OpenHands/software-agent-sdk

Dockerfile best practice: add --no-install-recommends to apt-get install commands in agent-server Dockerfile

Open Beginner friendly
#5,049 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

docker enhancement good first issue
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:

  1. Docker Engine install (line ~380): apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
  2. 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 install commands in the agent-server Dockerfile use --no-install-recommends
  • Docker image still builds and functions correctly

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.