Skip to content

Adding locales to an alpine container in a single easy step

License

Notifications You must be signed in to change notification settings

wkrea/alpine-localized-docker

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

alpine-localized-docker

Adding locales to an alpine container in a single easy step.

Building an image

Build a test image named alpine-localized with

docker build -t alpine-localized .

Test if locales work with

docker run alpine-localized sh -c 'date && LC_ALL=de_DE.UTF-8 date'

Incorporating the image into your container

Either use this image as a base, or copy the two steps from this dockerfile into your own.

Using locales

  • Set the environment variables LC_... to your favorite locale.
  • in C(++), using newlocale() also works
  • either way, as of now, musl requires you to use the full locale name like de_DE.UTF-8. Using just de_DE doesn't seem to work

Creating or modifying locales

Per default, locales are maintained and pulled from https://gitlab.com/rilian-la-te/musl-locales. Currently, the selection of locales is very limited and incomplete, but you are welcome to create your own. To do so, clone that repository, modify the existing .po files or create a new one.

Then, you can:

  • test your new creations by changing the repository address inside the Dockerfile to your own clone
  • make a merge request upstream

Credits

Konstantin from https://gitlab.com/rilian-la-te/musl-locales for the locale program.

About

Adding locales to an alpine container in a single easy step

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dockerfile 100.0%