Giter VIP home page Giter VIP logo

Comments (2)

dominictayloruk avatar dominictayloruk commented on September 27, 2024

Not sure I'll have to have a look, pretty certain the image will need updating as it's old.

from alpine-postgres.

dominictayloruk avatar dominictayloruk commented on September 27, 2024

Just had a look into this, if we wanted to change to Spanish (es_ES);

If we create the following Dockerfile

FROM yobasystems/alpine-postgres:latest

RUN apk --no-cache add \
    tzdata \
    musl-locales \
    musl-locales-lang
RUN cp /usr/share/zoneinfo/Europe/Madrid /etc/localtime
RUN rm -r /usr/share/zoneinfo/Africa && \
    rm -r /usr/share/zoneinfo/Antarctica && \
    rm -r /usr/share/zoneinfo/Arctic && \
    rm -r /usr/share/zoneinfo/Asia && \
    rm -r /usr/share/zoneinfo/Atlantic && \
    rm -r /usr/share/zoneinfo/Australia && \
    rm -r /usr/share/zoneinfo/America  && \
    rm -r /usr/share/zoneinfo/Indian && \
    rm -r /usr/share/zoneinfo/Mexico && \
    rm -r /usr/share/zoneinfo/Pacific && \
    rm -r /usr/share/zoneinfo/Chile && \
    rm -r /usr/share/zoneinfo/Canada
RUN echo "Europe/Madrid" >  /etc/timezone
ENV TZ Europe/Madrid
ENV LANG es_ES.UTF-8
ENV LANGUAGE es_ES.UTF-8
ENV LC_ALL es_ES.UTF-8

ENV MUSL_LOCPATH="/usr/share/i18n/locales/musl"

The we build the container

docker build -t postgres-spanish .

Then we can run the container

docker run --name postgres -e POSTGRES_PASSWORD=password -p 5432:5432 -d postgres-spanish

Then we check the locale in the running container

docker exec -it postgres psql -U postgres -l 

Gives the following results

   Name    |  Owner   | Encoding | Locale Provider |   Collate   |    Ctype    | ICU Locale | ICU Rules |   Access privileges
-----------+----------+----------+-----------------+-------------+-------------+------------+-----------+-----------------------
 postgres  | postgres | UTF8     | libc            | es_ES.UTF-8 | es_ES.UTF-8 |            |           |
 template0 | postgres | UTF8     | libc            | es_ES.UTF-8 | es_ES.UTF-8 |            |           | =c/postgres          +
           |          |          |                 |             |             |            |           | postgres=CTc/postgres
 template1 | postgres | UTF8     | libc            | es_ES.UTF-8 | es_ES.UTF-8 |            |           | =c/postgres          +
           |          |          |                 |             |             |            |           | postgres=CTc/postgres

It looks to have change the locale in the db, will need checking further then maybe we can add it into the image without having to rebuild and specify at run time instead.

from alpine-postgres.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.