fix(docker): add coreutils so MAX_LIFETIME_SECONDS works on Wolfi base - #586
Open
agarctfi wants to merge 1 commit into
Open
fix(docker): add coreutils so MAX_LIFETIME_SECONDS works on Wolfi base#586agarctfi wants to merge 1 commit into
agarctfi wants to merge 1 commit into
Conversation
scripts/app-start.sh invokes GNU `timeout` with --preserve-status and --foreground when MAX_LIFETIME_SECONDS is set. The Wolfi base only ships BusyBox `timeout`, which rejects those flags, so the server never starts and the container restart-loops. GNU coreutils rode in for free on the old RockyLinux base and was lost in the RockyLinux -> Wolfi switch (PR #423). Add coreutils to the image to restore GNU `timeout`. Verified against the real app-start.sh: the server now starts and runs for the full lifetime. grype shows adding coreutils introduces 0 new CVEs (6 Chainguard-maintained packages, ~10 MB). Reported in Pylon 2657. Fixes ENG-1428. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
agarctfi
force-pushed
the
fix/eng-1428-coreutils-timeout
branch
from
August 27, 2026 15:56
1ce331c to
72ffc71
Compare
agarctfi
marked this pull request as ready for review
August 27, 2026 16:40
There was a problem hiding this comment.
No issues found across 3 files
Shadow auto-approve: would not auto-approve. This PR does not meet the repository auto-approval settings.
Re-trigger cubic
agarctfi
requested review from
a team,
awalker4,
lawrence-u10d and
luke-kucing
August 27, 2026 16:43
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MAX_LIFETIME_SECONDSis broken on the publishedunstructured-apiimage and has been since the base image moved from RockyLinux to Chainguard Wolfi (#423).scripts/app-start.shruns GNUtimeoutwith--preserve-statusand--foregroundwhenMAX_LIFETIME_SECONDSis set. The Wolfi base only provides BusyBoxtimeout, which does not support those flags, so BusyBox rejects the first one and exits non-zero. uvicorn never launches, the script falls through to its shutdown echoes, and a container with a restart policy loops.GNU coreutils shipped for free as part of the old RockyLinux userland and was lost in the distro swap; it has never been an explicit package in the Dockerfile. This PR adds it back.
Reported in Pylon 2657. Fixes ENG-1428.
Reproduction
Runs the real
scripts/app-start.shwith a stub standing in for uvicorn.Current base (BusyBox
timeout), server never starts:The stub "server started" line never prints.
With this fix (base + coreutils), server launches and runs for the full lifetime:
CVE impact
apk add coreutilswas scanned with grype (DB 27 August 2026) oncgr.dev/chainguard/wolfi-base:latest:It pulls in 6 Chainguard-maintained packages (coreutils, libacl1, libattr1, libpcre2-8-0, libselinux, libsepol), all with no known vulnerabilities. Image size grows about 10 MB. Adding coreutils does not reintroduce the RockyLinux CVE surface that #423 was shedding.
Notes
app-start.sh(command -v timeout) is also broken independent of the base image: BusyBoxtimeoutsatisfies the check, so the intendedgtimeoutfallback never runs. This PR fixes the reported bug by making GNUtimeoutpresent; hardening the script to detect BusyBox vs GNU would make it robust regardless of base and can be a follow-up.core-productmirror of this Dockerfile (basecgr.dev/unstructured.io/python-fips:3.12-dev) is also Wolfi-based and lacks coreutils, so it needs the same change.Test plan
app-start.shon the current base