¡Ü interactive mode ·Î µµÄ¿ À̹ÌÁö ½ÇÇà.
¾Æ·¡ ¸í·ÉÀ» »ç¿ëÇÏ¿© ¿ìºÐÅõ À̹ÌÁö¸¦ ½ÇÇàÇÏ¿© ÇöÀç locale À» È®ÀÎÇÑ´Ù.
ÇöÀç µµÄ¿ ·¹Æ÷ÁöÅ丮¸¦ ÅëÇØ ¹èÆ÷µÇ´Â ´ëºÎºÐÀÇ ¿ìºÐÅõ À̹ÌÁö´Â locale ¼³Á¤ÀÌ ¾ÈµÇ¾î ÀÖÀ»°ÍÀÌ´Ù.
(¿Ü±¹ ¾ÖµéÀº ÇѱÛÀ̳ª ÀϺ»¾î, Áß±¹¾î µûÀ© °ü½É ¾øÀ»Å×´Ï...)
docker run -it [IMAGE] /bin/bash
[zany@dione ~]$ docker run -it -u root ubuntu:base /bin/bash
[root@510a1395b315 ~]# locale
LANG=
LANGUAGE=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=
[root@510a1395b315 ~]# locale -a
C
C.UTF-8
POSIX
[root@510a1395b315 ~]# ls /usr/share/i18n/locales/
ls: cannot access '/usr/share/i18n/locales/': No such file or directory
locale ¸í·ÉÀ» ÀÔ·ÂÇØº¸¸é, POSIX ·Î Ç¥±âµÉ °ÍÀ̰í
locale -a ¸í·ÉÀ¸·Î »ç¿ë °¡´ÉÇÑ locale ¸ñ·ÏÀ» º¸¸é À§ °á°ú¿Í °°ÀÌ ¸î°³ ¾È³ª¿Ã °ÍÀÌ´Ù.
/usr/share/i18n/locales µð·ºÅ丮´Â Á¸ÀçÇÏÁöµµ ¾Ê´Â´Ù.
echo 'ÇѱÛ' ¸í·ÉÀ¸·Î tty ¿¡¼ ÇѱÛÀÌ µÇ´ÂÁö È®ÀÎÇÏÁöµµ ¸øÇÑ´Ù.
echo 'ÇѱÛ' À̶ó´Â ¸í·É¾î ÀÚüµµ ÀÔ·Â ¸øÇÒÅ×´Ï...
¡Ü ¿ìºÐÅõ ÆÐŰÁö ¸Å´ÏÀú·Î locales ¼³Ä¡
locale ÀÌ ÀÖ¾î¾ß ¼³Á¤À» ÇÏµç ¸»µç ÇÒÅ×´Ï...
ÀÏ´Ü ¿ìºÐÅõ ÆÐŰÁö ¸Å´ÏÀú(apt-get)¸¦ ÅëÇØ locales ÆÐŰÁö¸¦ ¼³Ä¡ÇÏÀÚ (¾Æ·¡ ¸í·É)
apt-get upgrade ´Â OS ¿¡ ¼³Ä¡µÈ ÆÐŰÁö¸¦ ¾÷±×·¹À̵å ÇÒ °ÍÀÌ´Ï ÇÊ¿äÄ¡ ¾ÊÀ¸¸é »©µµ ¹«¹æÇÏ´Ù.
apt-get clean && apt-get update && apt-get upgrade && apt-get install locales
[root@510a1395b315 ~]# apt-get clean && apt-get update && apt-get upgrade && apt-get install locales
Get:1 http://archive.ubuntu.com/ubuntu xenial InRelease [247 kB]
Get:2 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
Get:3 http://security.ubuntu.com/ubuntu xenial-security/universe Sources [51.1 kB]
Get:4 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB]
... ¾î¼±¸ Àú¼±¸ »ý·« ...
Selecting previously unselected package locales.
(Reading database ... 13279 files and directories currently installed.)
Preparing to unpack .../locales_2.23-0ubuntu9_all.deb ...
Unpacking locales (2.23-0ubuntu9) ...
Setting up locales (2.23-0ubuntu9) ...
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76.)
debconf: falling back to frontend: Readline
Generating locales (this might take a while)...
Generation complete.
Á¤»óÀûÀ¸·Î 󸮵ǾúÀ¸¸é, /usr/share/i18n/locales/ µð·ºÅ丮¿¡ locale ÆÄÀϵéÀÌ »ý°åÀ» °ÍÀÌ´Ù.
ls ¸í·ÉÀ¸·Î /usr/share/i18n/locales/ µð·ºÅ丮ÀÇ ³»¿ëÀ» º¸ÀÚ.
ls /usr/share/i18n/locales/
[root@510a1395b315 ~]# ls /usr/share/i18n/locales/
C bs_BA en_ZM ga_IE@euro li_BE ps_AF tk_TM
POSIX byn_ER en_ZW gd_GB li_NL pt_BR tl_PH
aa_DJ ca_AD eo gez_ER lij_IT pt_PT tn_ZA
aa_ER ca_ES eo_US gez_ER@abegede ln_CD pt_PT@euro tr_CY
aa_ER@saaho ca_ES@euro es_AR gez_ET lo_LA quz_PE tr_TR
aa_ET ca_ES@valencia es_BO gez_ET@abegede lt_LT raj_IN translit_circle
af_ZA ca_FR es_CL gl_ES lv_LV ro_RO translit_cjk_compat
ak_GH ca_IT es_CO gl_ES@euro lzh_TW ru_RU translit_cjk_variants
am_ET ce_RU es_CR gu_IN mag_IN ru_UA translit_combining
an_ES ckb_IQ es_CU gv_GB mai_IN rw_RW translit_compat
anp_IN cmn_TW es_DO ha_NG mg_MG sa_IN translit_font
ar_AE crh_UA es_EC hak_TW mhr_RU sat_IN translit_fraction
ar_BH cs_CZ es_ES he_IL mi_NZ sc_IT translit_hangul
ar_DZ csb_PL es_ES@euro hi_IN mk_MK sd_IN translit_narrow
... »ý·« ...
apt-get install locales ¸í·É½Ã ÀÚµ¿À¸·Î locale-gen ¸í·ÉÀÌ ¼öÇàµÇÁö¸¸,
/usr/share/i18n/locales µð·ºÅ丮°¡ ¾ÆÁ÷ º¸ÀÌÁö ¾ÊÀ¸¸é locale-gen ¸í·ÉÀ» º°µµ·Î ¼öÇàÇØº¸ÀÚ.
locales ÆÐŰÁö¸¦ ¼³Ä¡ÇÏ¿©µµ »ç¿ë °¡´ÉÇÑ locale À» È®ÀÎÇØº¸¸é ¾ÆÁ÷ ¿øÇÏ´Â °ÍÀÌ ³ª¿ÀÁö ¾Ê´Â´Ù.
locale -a
[root@510a1395b315 ~]# locale -a
C
C.UTF-8
POSIX
¡Ü locale »ý¼º / µî·Ï
localedef ¸í·ÉÀ» ÀÌ¿ëÇÏ¿© ÇÊ¿äÇÑ locale À» ÄÄÆÄÀÏÇØÁØ´Ù.
-i ¿É¼ÇÀº inputfile À» ÀǹÌÇϸç
-f ¿É¼ÇÀº ¹®ÀÚ¼ÂÀ» ÀǹÌÇÑ´Ù.
localedef ¸í·É ÈÄ, locale -a ¸í·ÉÀ¸·Î »ç¿ë °¡´ÉÇÑ locale À» È®ÀÎÇØº¸¸é »õ·Î Ãß°¡ÇÑ 2°³ÀÇ Ç׸ñÀÌ º¸ÀÏ °ÍÀÌ´Ù.
localedef -i ko_KR -f UTF-8 ko_KR.UTF-8
localedef -i en_US -f UTF-8 en_US.UTF-8
locale -a
[root@510a1395b315 ~]# localedef -i ko_KR -f UTF-8 ko_KR.UTF-8
[root@510a1395b315 ~]# localedef -i en_US -f UTF-8 en_US.UTF-8
[root@510a1395b315 ~]# locale -a
C
C.UTF-8
POSIX
en_US.utf8
ko_KR.utf8
¡Ü locale °ü·Ã ÆÐŰÁö Àç¼³Á¤ (optional)
dpkg-reconfigure ¸í·ÉÀ¸·Î locale ¼³Á¤À» ´Ù½Ã ÇØÁØ´Ù.
¾Æ·¡ ¸í·É¾î¸¦ ½ÇÇàÇϸé 2°¡Áö¸¦ ¹¯´Â´Ù.
1. ¾î¶² locale À» »ç¿ëÇÒ °ÍÀ̳Ä?
2. ½Ã½ºÅÛ È¯°æÀ» À§ÇÑ ±âº» locale À» ¹»·Î ÇÒ²¨³Ä?
dpkg-reconfigure locales
[root@510a1395b315 ~]# dpkg-reconfigure locales
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "ko_KR.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
debconf: unable to initialize frontend: Dialog
debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76.)
debconf: falling back to frontend: Readline
Configuring locales
-------------------
Locales are a framework to switch between multiple languages and allow users to use their language, country, characters,
collation order, etc.
Please choose which locales to generate. UTF-8 locales should be chosen by default, particularly for new installations.
Other character sets may be useful for backwards compatibility with older systems and software.
1. All locales 162. es_CL ISO-8859-1 323. mni_IN UTF-8
2. aa_DJ ISO-8859-1 163. es_CL.UTF-8 UTF-8 324. mr_IN UTF-8
3. aa_DJ.UTF-8 UTF-8 164. es_CO ISO-8859-1 325. ms_MY ISO-8859-1
4. aa_ER UTF-8 165. es_CO.UTF-8 UTF-8 326. ms_MY.UTF-8 UTF-8
5. aa_ER@saaho UTF-8 166. es_CR ISO-8859-1 327. mt_MT ISO-8859-3
6. aa_ET UTF-8 167. es_CR.UTF-8 UTF-8 328. mt_MT.UTF-8 UTF-8
7. af_ZA ISO-8859-1 168. es_CU UTF-8 329. my_MM UTF-8
8. af_ZA.UTF-8 UTF-8 169. es_DO ISO-8859-1 330. nan_TW UTF-8
9. ak_GH UTF-8 170. es_DO.UTF-8 UTF-8 331. nan_TW@latin UTF-8
10. am_ET UTF-8 171. es_EC ISO-8859-1 332. nb_NO ISO-8859-1
... »ý·« ...
(Enter the items you want to select, separated by spaces.)
Locales to be generated: 290
... »ý·« ...
This will select the default language for the entire system. If this system is a multi-user system where not all users are
able to speak the default language, they will experience difficulties.
1. None 2. C.UTF-8 3. ko_KR.UTF-8
Default locale for the system environment: 3
ko_KR.UTF-8 ÀÌ 290 ¹ø ÀÌ¾î¼ 290 À¸·Î ÀÔ·Â ÇÏ¿´À¸³ª,
OS ¹öÀü¿¡ µû¶ó ´Ù¸¦ ¼ö ÀÖÀ¸´Ï ¸ñ·Ï¿¡¼ ÀûÀýÇÑ ¹øÈ£¸¦ °ñ¶ó ÀÔ·ÂÇÑ´Ù.
¡Ü .bashrc ¿¡ LANG ȯ°æ°ª Ãß°¡
LANG ȯ°æ°ªÀ» .bashrc ¿¡ µî·ÏÇØÁØ´Ù.
export LANG=ko_KR.UTF-8
¡Ü µµÄ¿ Ä¿¹Ô ÈÄ... Àç½ÇÇà.. È®ÀÎ.
ÇöÀç µµÄ¿¸¦ Ä¿¹ÔÇϰí Á¾·á ÈÄ Àç½ÇÇàÇÏ¿© locale ÀÌ Á¤»óÀûÀ¸·Î Àû¿ëµÇ¾ú´ÂÁö È®ÀÎÇÏÀÚ.
µµÄ¿¸¦ Ä¿¹ÔÇÏÁö ¾ÊÀ¸¸é º¯°æ ³»¿ëÀÌ À̹ÌÁö¿¡ ±â·ÏµÇÁö ¾ÊÀ¸´Ï ²À Ä¿¹ÔÇϰí Àç½ÇÇàÇØ¼ È®ÀÎÇÏÀÚ.
docker commit -p [CONTAINER] [REPOSITORY[:TAG]]
[zany@dione ~]$ docker commit -p 510a1395b315 ubuntu:base
sha256:65afd6c09559b1001316c067b075e3a73c5aa02132752a9e184b0dedf2be2097
[root@a0610820dc88 ~]# locale
LANG=ko_KR.UTF-8
LANGUAGE=
LC_CTYPE="ko_KR.UTF-8"
LC_NUMERIC="ko_KR.UTF-8"
LC_TIME="ko_KR.UTF-8"
LC_COLLATE="ko_KR.UTF-8"
LC_MONETARY="ko_KR.UTF-8"
LC_MESSAGES="ko_KR.UTF-8"
LC_PAPER="ko_KR.UTF-8"
LC_NAME="ko_KR.UTF-8"
LC_ADDRESS="ko_KR.UTF-8"
LC_TELEPHONE="ko_KR.UTF-8"
LC_MEASUREMENT="ko_KR.UTF-8"
LC_IDENTIFICATION="ko_KR.UTF-8"
LC_ALL=
[root@a0610820dc88 ~]# echo 'ÇѱÛ'
ÇѱÛ
[root@a0610820dc88 ~]#
|