21
12

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

docker上のdebianのlocale問題で文字化けする場合

Posted at

環境

docker 1.6.2
debian : jessie
docker上のdebian : jessie

症状

docker上のos(debian)のlocale設定されてないために、
日本語ファイルが文字化けする。
自分はdockerfileでgit cloneしてきたファイル内に日本語が入っていたため
ここで躓いた。

対策

Dockerfileに以下を記せばok

RUN apt-get install locales
RUN locale-gen ja_JP.UTF-8
ENV LANG ja_JP.UTF-8
ENV LC_CTYPE ja_JP.UTF-8
RUN localedef -f UTF-8 -i ja_JP ja_JP.utf8

※ 他のサイトとか見てると最後の一行ないのが多いけど、自分の場合だと動かなかった。

21
12
2

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
21
12

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?