forked from Docker/baseimage-docker
Fix prepare.sh for building on Debian base images
The official Debian images differ from the Ubuntu ones in ways that break image/prepare.sh. Install python3 explicitly (my_init is a Python 3 script, and the Debian images do not ship python3), restrict software-properties-common to Ubuntu since Trixie does not provide it, and detect the distribution from /etc/os-release instead of lsb_release, which is not installed on Debian.
This commit is contained in:
1 parent
64df8f2d71
commit
81490388e5
1 file changed
+9
-4
+9
-4
@@ -50,7 +50,12 @@ $minimal_apt_get_install apt-utils
|
||||
$minimal_apt_get_install apt-transport-https ca-certificates
|
||||
|
||||
## Install add-apt-repository
|
||||
$minimal_apt_get_install software-properties-common
|
||||
if grep -E '^ID=' /etc/os-release | grep -q ubuntu; then
|
||||
$minimal_apt_get_install software-properties-common
|
||||
fi
|
||||
|
||||
## Install python3 for debian
|
||||
$minimal_apt_get_install python3
|
||||
|
||||
## Upgrade all packages.
|
||||
apt-get dist-upgrade -y --no-install-recommends -o Dpkg::Options::="--force-confold"
|
||||
@@ -95,11 +100,11 @@ if grep -E '^ID=' /etc/os-release | grep -q ubuntu; then
|
||||
fi
|
||||
|
||||
## Fix locale.
|
||||
case $(lsb_release -is) in
|
||||
Ubuntu)
|
||||
case $(grep '^ID=' /etc/os-release | cut -d= -f2) in
|
||||
ubuntu)
|
||||
$minimal_apt_get_install language-pack-en
|
||||
;;
|
||||
Debian)
|
||||
debian)
|
||||
$minimal_apt_get_install locales locales-all
|
||||
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
|
||||
;;
|
||||
|
||||
Reference in new issue
Block a user