天天看點

【雲計算】Docker 鏡像如何設定語言環境?bash: warning: setlocale: LC_ALL: cannot change locale (en_US)

解決方案:

# set default language environment
RUN locale-gen en_US.UTF-8 \
    && dpkg-reconfigure locales
ENV LC_ALL=en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US.UTF-8


OR:      
sudo locale-gen en_US.UTF-8

              sudo dpkg-reconfigure locales           
vi /etc/default/locale
LC_ALL=en_US.UTF-8 
LANG=en_US.UTF-8
重新登入伺服器,warning 警告不再出現,問題解決
           

參考資料:

1、bash: warning: setlocale: LC_ALL: cannot change locale (en_US):

http://blog.163.com/fl_xiang/blog/static/194634512201291231429799/

https://www.xdty.org/912

https://blogs.oracle.com/sakshijain/entry/the_problem_of_setting_locale

http://www.cnblogs.com/ifantastic/p/4565822.html

http://www.tuicool.com/articles/qYrIvm/

2、How to source /etc/profile and save it in docker?

http://stackoverflow.com/questions/31216780/how-to-source-etc-profile-and-save-it-in-docker

3、sudo指令報錯

http://www.cnblogs.com/wangkongming/p/4451629.html