Last active
April 12, 2019 03:03
-
-
Save NateScarlet/5649be81cc750a7a070a9a1cc49c28cf to your computer and use it in GitHub Desktop.
boot2docker(tinycore) cn locale setup 设置中国本地化
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo http://mirrors.163.com/tinycorelinux/ | sudo tee /opt/tcemirror | |
echo '[global] | |
index-url = https://mirrors.aliyun.com/pypi/simple' | sudo tee /etc/pip.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
TARGET=zh_CN | |
su docker -c ' | |
tce-load -wic getlocale coreutils | |
' | |
sudo mkdir -p /usr/lib/locale | |
localedef -c -f UTF-8 -i ${TARGET} ${TARGET}.utf8 | |
( tempdir=`mktemp -d` | |
cd $tempdir | |
mkdir -p usr/lib/locale | |
cp -a /usr/lib/locale/locale-archive usr/lib/locale | |
cd .. | |
chmod 755 $tempdir | |
rm -f ${TARGET}-locale.tcz | |
mksquashfs $tempdir ${TARGET}-locale.tcz > /dev/null 2>&1 | |
rm -rf $tempdir | |
) & | |
rotdash $! | |
TCEDIR=/tmp/tce | |
OPTIONAL=${TCEDIR}/optional | |
cp /tmp/${TARGET}-locale.tcz $OPTIONAL | |
grep -q "^${TARGET}-locale.tcz" ${TCEDIR}/onboot.lst 2>/dev/null || echo "${TARGET}-locale.tcz" >> ${TCEDIR}/onboot.lst | |
echo "glibc_gconv.tcz" > ${OPTIONAL}/${TARGET}-locale.tcz.dep | |
md5sum ${OPTIONAL}/${TARGET}-locale.tcz > ${OPTIONAL}/${TARGET}-locale.tcz.md5.txt | |
su docker -c " | |
tce-load -i ${TARGET}-locale | |
" | |
echo "\ | |
LANG=${TARGET}.utf8 | |
LC_ALL=${TARGET}.utf8 | |
" | sudo tee /etc/sysconfig/language |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
su docker -c ' | |
tce-load -wic tzdata' | |
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
su docker -c ' | |
tce-load -wic python3.6 \ | |
&& sudo pip3 install --upgrade pip \ | |
&& sudo pip3 install --upgrade docker-compose \ | |
' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment