LoginSignup
6
12

More than 3 years have passed since last update.

【Docker】Docker環境内で日本語入力

Last updated at Posted at 2020-06-19

諸説ありますがこれでいけました。
下記記載の各 RUN コマンドを実行しないとうまくいきませんでした。

Docker Imageはruby2.4.3(おそらくUbuntu16)。

# Japanese
RUN apt-get update \
    && apt-get install -y locales \
    && locale-gen ja_JP.UTF-8
ENV LANG ja_JP.UTF-8
ENV LANGUAGE ja_JP:ja
ENV LC_ALL=ja_JP.UTF-8
RUN localedef -f UTF-8 -i ja_JP ja_JP.utf8

参考リンク

https://qiita.com/motoki_giants/items/0c3b9d174edef9410310
https://qiita.com/munimuni/items/93a87ff4a6366eb13f0d

おまけ

日本語環境の設定という点では、時刻をUTCからJST表示にするのも良いでしょう。

docker-composeを使用している場合はdocker-compose.ymlで

docker-compose.yml

web:
  environment:
    TZ: Japan

とすると、JST表示になります。

6
12
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
12