Skip to content

Commit

Permalink
Add script to install locale (home-assistant#25791)
Browse files Browse the repository at this point in the history
  • Loading branch information
Santobert authored and pvizeli committed Aug 9, 2019
1 parent 6909235 commit a66814c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions virtualization/Docker/Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 12 additions & 0 deletions virtualization/Docker/scripts/locales
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions virtualization/Docker/setup_docker_prereqs
Original file line number Diff line number Diff line change
Expand Up @@ -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=(
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a66814c

Please sign in to comment.