docker: enable UTF-8 locale

Python 3 is a lot more sensitive to locale, plus we will definitely be
dealing with non-ASCII names and email addresses, so we need to get this
right.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
This commit is contained in:
Paul Eggleton 2018-07-09 15:55:34 +02:00
parent 1bb2d1fd7c
commit 163a84ff00
2 changed files with 9 additions and 2 deletions

View File

@ -2,7 +2,10 @@ FROM buildpack-deps:latest
LABEL maintainer="Michael Halstead <mhalstead@linuxfoundation.org>" LABEL maintainer="Michael Halstead <mhalstead@linuxfoundation.org>"
EXPOSE 80 EXPOSE 80
ENV PYTHONUNBUFFERED 1 ENV PYTHONUNBUFFERED=1 \
LANG=en_US.UTF-8 \
LC_ALL=en_US.UTF-8 \
LC_CTYPE=en_US.UTF-8
## Uncomment to set proxy ENVVARS within container ## Uncomment to set proxy ENVVARS within container
#ENV http_proxy http://your.proxy.server:port #ENV http_proxy http://your.proxy.server:port
#ENV https_proxy https://your.proxy.server:port #ENV https_proxy https://your.proxy.server:port
@ -17,10 +20,14 @@ RUN apt-get install -y --no-install-recommends \
python3-mysqldb \ python3-mysqldb \
python3-dev \ python3-dev \
python3-pil \ python3-pil \
locales \
rabbitmq-server \ rabbitmq-server \
netcat-openbsd \ netcat-openbsd \
vim \ vim \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
RUN echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \
&& locale-gen en_US.UTF-8 \
&& update-locale
RUN pip install --upgrade pip RUN pip install --upgrade pip
RUN pip3 install gunicorn RUN pip3 install gunicorn
RUN pip install setuptools RUN pip install setuptools

View File

@ -10,7 +10,7 @@ docker build -t halstead/layerindex-web -f Dockerfile.web .
## 'PASSWORD': 'testingpw', ## 'PASSWORD': 'testingpw',
## 'HOST': 'layersdb', ## 'HOST': 'layersdb',
## 'PORT': '', ## 'PORT': '',
docker run -d --name layerdb -e MYSQL_ROOT_PASSWORD=testingpw -e MYSQL_DATABASE=layersdb mariadb docker run -d --name layerdb -e MYSQL_ROOT_PASSWORD=testingpw -e MYSQL_DATABASE=layersdb mariadb --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
## If you have a copy of the the production data now is the time to insert it. ## If you have a copy of the the production data now is the time to insert it.
## If not you can skip the next step for a clean install. ## If not you can skip the next step for a clean install.