How to change languages of mysql in Dockerfile

My software’s language had to be switched from English to Japanese in Docker mysql. My server is ubuntu.

Conclusion

# Dockerfile
RUN apt-get update && apt-get install -y locales \
&& sed -i -e 's/# \(ja_JP.UTF-8\)/\1/' /etc/locale.gen \
&& locale-gen \
&& update-locale LANG=ja_JP.UTF-8

It is possible to replace characters by using sed command and specify the file (in this case, it is the locale.gen file). The locales must be installed.

My LinkedIn account is below! Please contact me!

https://www.linkedin.com/in/tomoharu-tsutsumi-56051a126/

--

--

Tomoharu Tsutsumi

Senior Software Engineer Senior Software Engineer at an industry-leading startup( Ruby | JavaScript | Go | Rails | React | Redux | Gin)