How to change languages of mysql in Dockerfile
Dec 5, 2022
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.