Document Ubuntu 26.04 Rust Coreutils & sudo-rs changes, add GNU fallback build flag#661
Conversation
…NU_COREUTILS build flag Agent-Logs-Url: https://github.com/phusion/baseimage-docker/sessions/065ff4d3-d584-4cb8-8265-5d1f0f7dc3b1 Co-authored-by: Theaxiom <57013+Theaxiom@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Documents Ubuntu 26.04 LTS's shift to Rust-based uutils-coreutils and sudo-rs, and adds an opt-in build flag intended to swap those back for GNU Coreutils / traditional sudo when building on 26.04.
Changes:
- README: new "Ubuntu 26.04 LTS: Rust Coreutils and sudo-rs" section plus a note in the component table, covering compatibility/security/licensing/maturity tradeoffs and two mitigation options.
- Build config & Dockerfile: introduce
INSTALL_GNU_COREUTILS(default0) as a build-time flag. prepare.sh: on Ubuntu ≥26.04, when the flag is1, probe forcoreutils-gnuandsudo-traditional/sudo-classicviaapt-cache showand install whichever exist.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| README.md | Adds TOC entry, table note, and a new section explaining the 26.04 Rust tooling change with two workarounds. |
| image/buildconfig | Exports new INSTALL_GNU_COREUTILS variable defaulting to 0. |
| image/Dockerfile | Declares ARG INSTALL_GNU_COREUTILS=0 with a comment. |
| image/prepare.sh | Conditionally installs GNU coreutils / traditional sudo on Ubuntu ≥26.04 when the flag is set. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
@copilot apply changes based on the comments in this thread |
…dename Agent-Logs-Url: https://github.com/phusion/baseimage-docker/sessions/f25d0dfd-2691-466f-8dcc-1075a4824daf Co-authored-by: Theaxiom <57013+Theaxiom@users.noreply.github.com>
Applied all review feedback in commit
The two previously-resolved items (ARG→env passthrough in Dockerfile, and the error/exit on missing packages) were already in place from the prior commit. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
image/prepare.sh:93
- The replacement package names (
coreutils-gnu,sudo-traditional,sudo-classic) used here are speculative — the PR description itself acknowledges they "may need adjustment as Ubuntu 26.04 packaging stabilises." As written, on a real Ubuntu 26.04 system where none of these probed packages exist,INSTALL_GNU_COREUTILS=1will always fail the build at line 92 with the "ERROR: ... could not be fully installed" message, making the documented flag effectively non-functional. Consider either (a) deferring this code path until the actual package names are confirmed and adding them, or (b) explicitly documenting this as an experimental/forward-looking option that may not work on current 26.04 images, so users aren't surprised when the documented build command fails.
# Install GNU Coreutils if available (package name may vary by Ubuntu release).
# 'coreutils-gnu' is the expected package name for the GNU implementation
# when uutils-coreutils is the default.
if apt-cache show coreutils-gnu > /dev/null 2>&1; then
$minimal_apt_get_install coreutils-gnu
GNU_COREUTILS_INSTALLED=1
fi
# Install traditional sudo if available (package name may vary).
# 'sudo-traditional' or similar may be provided alongside 'sudo-rs'.
if apt-cache show sudo-traditional > /dev/null 2>&1; then
$minimal_apt_get_install sudo-traditional
TRADITIONAL_SUDO_INSTALLED=1
elif apt-cache show sudo-classic > /dev/null 2>&1; then
$minimal_apt_get_install sudo-classic
TRADITIONAL_SUDO_INSTALLED=1
fi
if [ "$GNU_COREUTILS_INSTALLED" -ne 1 ] || [ "$TRADITIONAL_SUDO_INSTALLED" -ne 1 ]; then
echo "*** ERROR: INSTALL_GNU_COREUTILS=1 was requested, but the requested replacements could not be fully installed." >&2
if [ "$GNU_COREUTILS_INSTALLED" -ne 1 ]; then
echo "*** ERROR: No GNU coreutils replacement package was found (tried: coreutils-gnu)." >&2
fi
if [ "$TRADITIONAL_SUDO_INSTALLED" -ne 1 ]; then
echo "*** ERROR: No traditional sudo replacement package was found (tried: sudo-traditional, sudo-classic)." >&2
fi
exit 1
fi
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
@copilot Please address all open comments on all open threads in this PR and synthesize the solution based on the inputs. |
… step Agent-Logs-Url: https://github.com/phusion/baseimage-docker/sessions/dda28199-53b3-47bb-acf4-8aec529f3e22 Co-authored-by: Theaxiom <57013+Theaxiom@users.noreply.github.com>
All open threads are now addressed in commit Open thread ( The previously-resolved threads were already addressed in prior commits:
|
|
Making changes and testing locally (with 24.04 & 26.04 Edit 1: commands used to test make build NAME=joe/stretch QEMU_ARCH=amd64 PLATFORM=linux/amd64
docker run -it --rm joe/stretch:noble-1.0.2 bash
make build NAME=joe/stretch QEMU_ARCH=amd64 PLATFORM=linux/amd64 VERSION=resolute-1.0.0 BASE_IMAGE=ubuntu:26.04
docker run -it --rm joe/stretch:resolute-1.0.0 bash
docker build --no-cache -t joe/stretch:resolute-1.0.0-gnu --build-arg BASE_IMAGE=ubuntu:26.04 --build-arg QEMU_ARCH=amd64 --build-arg INSTALL_GNU_COREUTILS=1 --platform linux/amd64 --rm image
docker run -it --rm joe/stretch:resolute-1.0.0-gnu bash |
|
@PikachuEXE sure, let's make sure the docs are aligned. 👍 |
|
Updated |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (2)
image/prepare.sh:78
apt-get remove ... coreutils-from-uutilsis executed unconditionally when the flag is enabled. If Ubuntu 26.04 ends up using a different package name (as the PR description suggests might happen), this will hard-fail the build. Consider probing for the package first (e.g., viaapt-cache show/dpkg -s) and emitting a clear error that includes the expected package name(s) when it's not present.
if [ "$INSTALL_GNU_COREUTILS_NORMALIZED" = "1" ]; then
echo "*** Removing Rust to restore GNU Coreutils..."
# GNU Coreutils can only be installed by removing `coreutils-from-uutils`
apt-get remove -y --allow-remove-essential coreutils-from-uutils
# Verify that GNU coreutils are now the active implementation on PATH.
image/prepare.sh:86
- The failure message says "coreutils-from-gnu was installed" but this script never installs that package (it only removes
coreutils-from-uutils). This makes the error misleading if the PATH check fails. Adjust the message to describe the actual action taken (e.g., removal ofcoreutils-from-uutils) and what the user should do next.
if ! ls --version 2>&1 | grep -qi 'gnu coreutils'; then
echo "*** ERROR: coreutils-from-gnu was installed but GNU coreutils are not active on PATH." >&2
echo "*** 'ls --version' does not report 'GNU coreutils'." >&2
echo "*** The package may place binaries outside the default PATH or require" >&2
echo "*** manual update-alternatives configuration. Check Ubuntu 26.04 packaging." >&2
exit 1
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
@PikachuEXE if you are happy with this, you can merge it. 👍 |
Ubuntu 26.04 LTS ships
uutils-coreutils(Rust) andsudo-rs(Rust) as defaults, replacing GNU Coreutils and traditional sudo. This has compatibility, licensing, and maturity implications that were previously undocumented.Documentation (
README.md)phusion/baseimage:noble-*(Ubuntu 24.04) for GNU toolingINSTALL_GNU_COREUTILS=1to restore GNU variants on 26.04Build infrastructure
image/buildconfig— addedINSTALL_GNU_COREUTILSflag (default0)image/Dockerfile— exposed asARG INSTALL_GNU_COREUTILS=0image/prepare.sh— on Ubuntu 26.04+, when flag is1, installscoreutils-gnuandsudo-traditional/sudo-classicif available viaapt-cache showprobe# Restore GNU Coreutils + traditional sudo on a 26.04-based build docker build --build-arg BASE_IMAGE=ubuntu:26.04 \ --build-arg INSTALL_GNU_COREUTILS=1 \ image/