Add script to install locale (#25791)

This commit is contained in:
Santobert 2019-08-09 21:08:35 +02:00 committed by Pascal Vizeli
parent 6909235d8a
commit a66814c772
4 changed files with 19 additions and 0 deletions

View File

@ -13,6 +13,7 @@ LABEL maintainer="Paulus Schoutsen <Paulus@PaulusSchoutsen.nl>"
#ENV INSTALL_SSOCR no
#ENV INSTALL_DLIB no
#ENV INSTALL_IPERF3 no
#ENV INSTALL_LOCALES no
VOLUME /config

View File

@ -14,6 +14,7 @@ LABEL maintainer="Paulus Schoutsen <Paulus@PaulusSchoutsen.nl>"
#ENV INSTALL_SSOCR no
#ENV INSTALL_DLIB no
#ENV INSTALL_IPERF3 no
#ENV INSTALL_LOCALES no
VOLUME /config

View File

@ -0,0 +1,12 @@
#!/bin/bash
# Sets up locales.
# Stop on errors
set -e
apt-get update
apt-get install -y --no-install-recommends locales
# Set the locale
sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen
locale-gen

View File

@ -9,6 +9,7 @@ INSTALL_OPENALPR="${INSTALL_OPENALPR:-yes}"
INSTALL_LIBCEC="${INSTALL_LIBCEC:-yes}"
INSTALL_SSOCR="${INSTALL_SSOCR:-yes}"
INSTALL_DLIB="${INSTALL_DLIB:-yes}"
INSTALL_LOCALES="${INSTALL_LOCALES:-yes}"
# Required debian packages for running hass or components
PACKAGES=(
@ -70,6 +71,10 @@ if [ "$INSTALL_DLIB" == "yes" ]; then
pip3 install --no-cache-dir "dlib>=19.5"
fi
if [ "$INSTALL_LOCALES" == "yes" ]; then
virtualization/Docker/scripts/locales
fi
# Remove packages
apt-get remove -y --purge ${PACKAGES_DEV[@]}
apt-get -y --purge autoremove