Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

With option ENABLE_CJK_FONT=1 the container fails to create #202

Closed
szom1 opened this issue Nov 5, 2023 · 5 comments
Closed

With option ENABLE_CJK_FONT=1 the container fails to create #202

szom1 opened this issue Nov 5, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@szom1
Copy link

szom1 commented Nov 5, 2023

Current Behavior

[cont-init ] 10-cjk-font.sh: installing CJK font...
[cont-init ] 10-cjk-font.sh: fetch http://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz
[cont-init ] 10-cjk-font.sh: fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/main/x86_64/APKINDEX.tar.gz
[cont-init ] 10-cjk-font.sh: fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/community/x86_64/APKINDEX.tar.gz
[cont-init ] 10-cjk-font.sh: ERROR: unable to select packages:
[cont-init ] 10-cjk-font.sh: font-wqy-zenhei (no such package):
[cont-init ] 10-cjk-font.sh: required by: world[font-wqy-zenhei]
[cont-init ] 10-cjk-font.sh: terminated with error 1.

Expected Behavior

Please fix this issue

Steps To Reproduce

No response

Environment

  • OS:
  • OS version:
  • CPU:
  • Docker version:
  • Device model:
  • Browser/OS:

Container creation

[cont-init ] 10-cjk-font.sh: installing CJK font...
[cont-init ] 10-cjk-font.sh: fetch http://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz
[cont-init ] 10-cjk-font.sh: fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/main/x86_64/APKINDEX.tar.gz
[cont-init ] 10-cjk-font.sh: fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/community/x86_64/APKINDEX.tar.gz
[cont-init ] 10-cjk-font.sh: ERROR: unable to select packages:
[cont-init ] 10-cjk-font.sh: font-wqy-zenhei (no such package):
[cont-init ] 10-cjk-font.sh: required by: world[font-wqy-zenhei]
[cont-init ] 10-cjk-font.sh: terminated with error 1.

Container log

[cont-init   ] 10-cjk-font.sh: installing CJK font...
[cont-init   ] 10-cjk-font.sh: fetch http://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz
[cont-init   ] 10-cjk-font.sh: fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/main/x86_64/APKINDEX.tar.gz
[cont-init   ] 10-cjk-font.sh: fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/community/x86_64/APKINDEX.tar.gz
[cont-init   ] 10-cjk-font.sh: ERROR: unable to select packages:
[cont-init   ] 10-cjk-font.sh:   font-wqy-zenhei (no such package):
[cont-init   ] 10-cjk-font.sh:     required by: world[font-wqy-zenhei]
[cont-init   ] 10-cjk-font.sh: terminated with error 1.

Container inspect

No response

Anything else?

No response

@szom1 szom1 added the bug Something isn't working label Nov 5, 2023
@jlesage
Copy link
Owner

jlesage commented Nov 5, 2023

Looks like the package moved to the community repo. I will fix this.

@stevenshea
Copy link

Thanks for your work.

I have this problem too.

Can you save this font package for good instead of downloading everytime after reboot?

@906051999
Copy link

解决方案:

  • 此时请停止容器

  • 下载一个中文字体,如AlibabaPuHuiTi-3-55-Regular.ttf

  • docker ps查看jlesage/firefox的容器ID

  • 用下面的命令把字体文件拷贝到容器里:

# docker cp [font file] [CONTAINER ID]:/usr/share/fonts/
docker cp AlibabaPuHuiTi-3-55-Regular.ttf 48aa47cbab16:/usr/share/fonts/
  • /usr/share/fonts/路径下新建一个文件夹cn,将字体文件移动到cn文件夹中

/usr/share/fonts/cn/AlibabaPuHuiTi-3-55-Regular.ttf

  • 进入docker中,编辑etc/cont-init.d/10-cjk-font.sh文件, 在判断中添加 || [ -d /usr/share/fonts/cn]
    if [ -d /usr/share/fonts/truetype/wqy ] || [ -d /usr/share/fonts/wenquanyi ] || [ -d /usr/share/fonts/wqy-zenhei ] || [ -d /usr/share/fonts/cn]
    then
        echo "CJK font already installed."
  • 保存后,重启docker容器即可

@jlesage
Copy link
Owner

jlesage commented Nov 9, 2023

Can you save this font package for good instead of downloading everytime after reboot?

Once installed, the package won't be re-installed everytime you restart the container. Only when re-creating the container.

@jlesage
Copy link
Owner

jlesage commented Nov 10, 2023

Fixed with the latest version of the image.

@jlesage jlesage closed this as completed Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants