mirror of
https://github.com/phusion/baseimage-docker.git
synced 2026-09-21 08:48:10 +00:00
docs: document Ubuntu 26.04 Rust Coreutils and sudo-rs, add INSTALL_GNU_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>
This commit is contained in:
co-authored by
Theaxiom
parent
169e147321
commit
1a930ec955
@@ -4,6 +4,11 @@ FROM $BASE_IMAGE
|
||||
ARG QEMU_ARCH
|
||||
#ADD x86_64_qemu-${QEMU_ARCH}-static.tar.gz /usr/bin
|
||||
|
||||
# Ubuntu 26.04+ ships uutils-coreutils (Rust) and sudo-rs (Rust) by default.
|
||||
# Set INSTALL_GNU_COREUTILS=1 to replace them with GNU Coreutils and
|
||||
# traditional sudo. Has no effect on Ubuntu releases prior to 26.04.
|
||||
ARG INSTALL_GNU_COREUTILS=0
|
||||
|
||||
COPY . /bd_build
|
||||
|
||||
RUN /bd_build/prepare.sh && \
|
||||
|
||||
@@ -7,3 +7,8 @@ minimal_apt_get_install='apt-get install -y --no-install-recommends'
|
||||
export DISABLE_SYSLOG=${DISABLE_SYSLOG:-0}
|
||||
export DISABLE_SSH=${DISABLE_SSH:-0}
|
||||
export DISABLE_CRON=${DISABLE_CRON:-0}
|
||||
|
||||
# Ubuntu 26.04+ ships uutils-coreutils (Rust) and sudo-rs (Rust) by default.
|
||||
# Set INSTALL_GNU_COREUTILS=1 to replace them with GNU Coreutils and
|
||||
# traditional sudo. Has no effect on Ubuntu releases prior to 26.04.
|
||||
export INSTALL_GNU_COREUTILS=${INSTALL_GNU_COREUTILS:-0}
|
||||
|
||||
@@ -55,6 +55,34 @@ $minimal_apt_get_install software-properties-common
|
||||
## Upgrade all packages.
|
||||
apt-get dist-upgrade -y --no-install-recommends -o Dpkg::Options::="--force-confold"
|
||||
|
||||
## Ubuntu 26.04+ ships uutils-coreutils (Rust) and sudo-rs (Rust) by default.
|
||||
## Optionally replace them with GNU Coreutils and traditional sudo when
|
||||
## INSTALL_GNU_COREUTILS=1 is set at build time.
|
||||
if grep -E '^ID=' /etc/os-release | grep -q ubuntu; then
|
||||
UBUNTU_VERSION=$(grep '^VERSION_ID=' /etc/os-release | cut -d'"' -f2)
|
||||
if dpkg --compare-versions "$UBUNTU_VERSION" ge "26.04" 2>/dev/null; then
|
||||
if [ "${INSTALL_GNU_COREUTILS:-0}" -eq 1 ]; then
|
||||
echo "*** Installing GNU Coreutils and traditional sudo to replace Rust variants..."
|
||||
# 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
|
||||
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
|
||||
elif apt-cache show sudo-classic > /dev/null 2>&1; then
|
||||
$minimal_apt_get_install sudo-classic
|
||||
fi
|
||||
else
|
||||
echo "*** Ubuntu 26.04 detected: using default uutils-coreutils (Rust) and sudo-rs (Rust)."
|
||||
echo "*** Set INSTALL_GNU_COREUTILS=1 at build time to use GNU Coreutils and traditional sudo instead."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
## Fix locale.
|
||||
case $(lsb_release -is) in
|
||||
Ubuntu)
|
||||
|
||||
Reference in New Issue
Block a user