Pre-install commonly needed system packages in agent container image#1432
Conversation
Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com> Agent-Logs-Url: https://github.com/github/gh-aw-firewall/sessions/e8563f79-69e4-48ef-84cd-98df7851552f
Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com> Agent-Logs-Url: https://github.com/github/gh-aw-firewall/sessions/e8563f79-69e4-48ef-84cd-98df7851552f
|
@copilot how does this affect agent container image size? |
Measured the impact on a fresh
The full layer (9 requested packages + 330 transitive dependencies) adds ~907 MB uncompressed to the image. The compressed Docker layer (what gets pulled) would be smaller, but this is still significant — mostly driven by For reference, the current agent image is ~200 MB. This would roughly 5× the image size. If that's a concern, we could consider:
|
|
@copilot go with your suggestions
And then measure the size impact |
Agent-Logs-Url: https://github.com/github/gh-aw-firewall/sessions/109bc7bc-c61b-481f-8398-7c6a21d34d50 Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Done in 9bfc7e9. Dropped
Updated both the Dockerfile and docs accordingly. |
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (1 files)
Coverage comparison generated by |
There was a problem hiding this comment.
Pull request overview
Adds a small set of preinstalled Ubuntu packages to the default agent container image to better match commonly available dependencies on GitHub Actions runners, reducing runtime setup time in workflows.
Changes:
- Install additional “runner-parity” packages in
containers/agent/Dockerfilewith existing apt retry +--no-install-recommendspattern. - Document the newly preinstalled packages in the agent image tools reference.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| containers/agent/Dockerfile | Adds a new apt install layer for parity packages (libgdiplus, libev-dev, libssl-dev, php-intl, php-gd). |
| docs-site/src/content/docs/reference/agent-images.md | Updates the agent image tools table to include the newly installed packages. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| | php-intl | — | `php-intl` | PHP Internationalization extension | | ||
| | php-gd | — | `php-gd` | PHP GD graphics extension | |
There was a problem hiding this comment.
The table lists php-intl/php-gd as available “tools”, but the agent image Dockerfile doesn’t appear to install a PHP runtime (php/php-cli). If PHP isn’t actually runnable in the image, these rows may be misleading—either add the runtime or note explicitly that only the extension packages/deps are present and php may not be available.
| | php-intl | — | `php-intl` | PHP Internationalization extension | | |
| | php-gd | — | `php-gd` | PHP GD graphics extension | | |
| | php-intl | — | `php-intl` | PHP Internationalization extension package/dependencies only; PHP runtime (`php`/`php-cli`) may not be installed | | |
| | php-gd | — | `php-gd` | PHP GD graphics extension package/dependencies only; PHP runtime (`php`/`php-cli`) may not be installed | |
| # These packages are commonly needed by workflows and avoid agents spending time installing them manually | ||
| # See: https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2204-Readme.md | ||
| RUN set -eux; \ | ||
| PARITY_PKGS="libgdiplus libev-dev libssl-dev php-intl php-gd"; \ |
There was a problem hiding this comment.
php-intl and php-gd are extensions but this Dockerfile doesn’t install a PHP runtime (php/php-cli). On Ubuntu, these packages may not provide the php executable, so workflows still won’t be able to run PHP. Either add an explicit PHP runtime package (e.g., php-cli/php) or clarify in docs/comments that PHP itself is not included and these are only for build dependencies.
| PARITY_PKGS="libgdiplus libev-dev libssl-dev php-intl php-gd"; \ | |
| # Include php-cli so that PHP workflows have a runtime, not just extensions. | |
| PARITY_PKGS="libgdiplus libev-dev libssl-dev php-cli php-intl php-gd"; \ |
| # Install additional system packages for GitHub Actions runner parity | ||
| # These packages are commonly needed by workflows and avoid agents spending time installing them manually | ||
| # See: https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2204-Readme.md | ||
| RUN set -eux; \ | ||
| PARITY_PKGS="libgdiplus libev-dev libssl-dev php-intl php-gd"; \ | ||
| apt-get update && \ | ||
| ( apt-get install -y --no-install-recommends $PARITY_PKGS || \ | ||
| (echo "apt-get install failed, retrying with fresh package index..." && \ | ||
| rm -rf /var/lib/apt/lists/* && \ | ||
| apt-get update && \ | ||
| apt-get install -y --no-install-recommends $PARITY_PKGS) ) && \ | ||
| rm -rf /var/lib/apt/lists/* |
There was a problem hiding this comment.
This new RUN duplicates the existing apt retry/install logic and does an additional apt-get update in a separate layer. To reduce build time and keep the Dockerfile simpler, consider folding PARITY_PKGS into the earlier PKGS install (same retry block) so the package index is fetched once per build step and the logic isn’t repeated.
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS
|
|
🔮 The oracle has read the runes of smoke test 23560473235.
Warning
|
The agent container lacks several packages present on GitHub Actions
ubuntu-latestrunners, forcing agents to install them at runtime and often exhausting their turn budget.Changes
containers/agent/Dockerfile— NewRUNlayer installs lightweight runner-parity packages with the same retry logic and--no-install-recommendspattern used by existing package installation:libgdiplus(GDI+ for .NET System.Drawing)libev-dev(high-performance event loop library)libssl-dev(OpenSSL development headers for native extensions)php-intl,php-gd(common PHP extensions)docs-site/.../agent-images.md— Documents new packages in the agent image tools tableHeavy packages (
pandoc,libgtk-4-dev,libadwaita-1-dev,opam) were excluded to keep image size reasonable — the lightweight set adds ~77 MB uncompressed (~38% increase) vs ~907 MB for the full set.All packages verified installable together on
ubuntu:22.04.Dockerfile.minimalunchanged — chroot mode relies on host tools.⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.