# Docker Debian based image does not have default locale set - Developers’ Notes

Source: https://www.ironin.it/blog/docker-debian-based-image-does-not-have-default-locale-set-developers-notes.html

Published 8 March 2019

[developers notes](https://www.ironin.it/blog/tags/developers-notes) [docker](https://www.ironin.it/blog/tags/docker)

![Docker Debian based image does not have default locale set - Developers’ Notes](https://www.ironin.it/api/media/file/ironin-seed-ODkzZTBjNGItNGQ4OS00YWM4LWE4ZDMtNzQzOWM5ZmI2YTgy_docker-debian-based-image-does-not-have-default-locale-set.jpg)

Here’s an easy fix for when Docker and the sablon gem don’t want to cooperate: just update your locale.

A problem with the [sablon](https://github.com/senny/sablon) gem occured when our team was developing an application locally in a Docker container. The Docker image based on `Debian Jessie` didn't have `locale` set which caused an encoding issue in `sablon`.

We updated our Dockerfile with the following lines to make sure `locale` is correctly set to `utf-8`:

```ruby
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
    echo 'LANG="en_US.UTF-8"'>/etc/default/locale && \
    dpkg-reconfigure --frontend=noninteractive locales && \
    update-locale LANG=en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
ENV LC_ALL en_US.UTF-8
```

In Ubuntu, there is the `update-locale` tool which lets you do it quickly: (`update-locale en_US.UTF-8`)

Today’s Developers’ Notes were delivered by Łukasz, our Web Application Development Team Leader. Watch out for more useful tips in the future!

Share:

Author: iRonin IT Team

Need software like this built?

[Software development →](https://www.ironin.it/ai-software-engineering)

Our code is merged into 10 open-source AI-agent projects, two of them with tens of thousands of GitHub stars.

[Talk to us →](https://www.ironin.it/contact-us.html?offer=ai-software-engineering)

## Read similar articles

- [Tutorial - A serverless web service with Node.js](https://www.ironin.it/blog/tutorial-a-serverless-web-service-with-node.html)
- [Why you should consider hiring contractors for your software project?](https://www.ironin.it/blog/hiring-contractors-for-software-development.html)
- [Foreman’s 10th birthday event - why we love being a part of the Foreman community](https://www.ironin.it/blog/foreman-development-10-years-anniversary.html)
- [Configuration Tutorial - hosting an Ember app on S3 and Cloudfront](https://www.ironin.it/blog/configuration-tutorial-hosting-an-ember-app-on-s3-and-cloudfront.html)

## Read next

- [Which AI model is best for your own task? Our own test and a public leaderboard disagreed](https://www.ironin.it/blog/own-ai-model-evals.html)
- [What uses up a Claude plan's usage limit? What each kind of token costs against it](https://www.ironin.it/blog/claude-usage-limit-token-costs.html)
- [Ready for employee evaluation?](https://www.ironin.it/blog/ready-for-employee-evaluation.html)
