mirror of
https://github.com/docker/docker-install.git
synced 2026-11-20 10:03:11 +03:00
install: Detect Ubuntu codename without /etc/lsb-release
Ubuntu 26.10 (stonking) images no longer ship /etc/lsb-release, and the base image has no lsb_release command. Both codename lookups returned nothing, so the apt source line had no suite and apt-get update failed: ``` deb [...] https://download-stage.docker.com/linux/ubuntu test E: Malformed entry 1 in list file /etc/apt/sources.list.d/docker.list (Component) ``` Read VERSION_CODENAME from /etc/os-release first, which every supported Ubuntu release provides and get_distribution already relies on. lsb_release and /etc/lsb-release remain as fallbacks when os-release has no codename. Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
1 file changed
+4
-1
+4
-1
@@ -507,7 +507,10 @@ do_install() {
|
||||
case "$lsb_dist" in
|
||||
|
||||
ubuntu)
|
||||
if command_exists lsb_release; then
|
||||
if [ -r /etc/os-release ]; then
|
||||
dist_version="$(. /etc/os-release && echo "$VERSION_CODENAME")"
|
||||
fi
|
||||
if [ -z "$dist_version" ] && command_exists lsb_release; then
|
||||
dist_version="$(lsb_release --codename | cut -f2)"
|
||||
fi
|
||||
if [ -z "$dist_version" ] && [ -r /etc/lsb-release ]; then
|
||||
|
||||
Reference in new issue
Block a user