docker - CentOS 7 Docker 镜像和语言环境编译

标签 docker locale centos7

我正在设置一个需要本地化支持的 Docker 镜像。我还需要根据 this thread 上的评论 #21 修补 pt_BR 语言环境.
所以我基本上做的是

  • 重新安装 glibc 以恢复丢失的语言环境
  • 根据上述 thread 编译 pt_BR .

  • 但是当我运行 localedef 时,出现编译错误。所以我最终尝试重新编译 pt_BR 语言环境本身,认为它可能与我的源文件有关,但我仍然遇到相同的错误。

    我不应该能够使用/usr/share/i18n/locales 中的文件重新编译语言环境吗?

    您将在下面找到更多详细信息

    Dockerfile
    FROM centos:7
    RUN yum reinstall -q -y glibc-common
    RUN cp /usr/share/i18n/locales/pt_BR pt_BR_abnt\.src
    RUN mkdir /usr/lib/locale/pt_BR_utf8_abnt
    RUN localedef --verbose -c -i pt_BR_abnt.src -f UTF-8 /usr/lib/locale pt_BR_utf8_abnt
    

    错误
    pt_BR_abnt.src:22: non-symbolic character value should not be used
    pt_BR_abnt.src:23: non-symbolic character value should not be used
    pt_BR_abnt.src:24: non-symbolic character value should not be used
    pt_BR_abnt.src:26: non-symbolic character value should not be used
    pt_BR_abnt.src:29: non-symbolic character value should not be used
    pt_BR_abnt.src:30: non-symbolic character value should not be used
    pt_BR_abnt.src:31: non-symbolic character value should not be used
    pt_BR_abnt.src:32: non-symbolic character value should not be used
    pt_BR_abnt.src:34: non-symbolic character value should not be used
    pt_BR_abnt.src:35: non-symbolic character value should not be used
    pt_BR_abnt.src:36: non-symbolic character value should not be used
    pt_BR_abnt.src:37: non-symbolic character value should not be used
    pt_BR_abnt.src:38: non-symbolic character value should not be used
    pt_BR_abnt.src:39: non-symbolic character value should not be used
    pt_BR_abnt.src:40: non-symbolic character value should not be used
    pt_BR_abnt.src:41: non-symbolic character value should not be used
    pt_BR_abnt.src:42: non-symbolic character value should not be used
    pt_BR_abnt.src:43: non-symbolic character value should not be used
    pt_BR_abnt.src:44: non-symbolic character value should not be used
    pt_BR_abnt.src:49: non-symbolic character value should not be used
    /usr/share/i18n/locales/iso14651_t1:3: non-symbolic character value should not be used
    pt_BR_abnt.src:76: non-symbolic character value should not be used
    /usr/share/i18n/locales/pt_PT:49: non-symbolic character value should not be used
    /usr/share/i18n/locales/i18n:1425: non-symbolic character value should not be used
    /usr/share/i18n/locales/i18n:1674: non-symbolic character value should not be used
    /usr/share/i18n/locales/i18n:1719: non-symbolic character value should not be used
    /usr/share/i18n/locales/i18n:1756: non-symbolic character value should not be used
    /usr/share/i18n/locales/pt_PT:56: non-symbolic character value should not be used
    /usr/share/i18n/locales/translit_neutral:10: non-symbolic character value should not be used
    /usr/share/i18n/locales/translit_neutral:11: non-symbolic character value should not be used
    /usr/share/i18n/locales/translit_neutral:12: non-symbolic character value should not be used
    /usr/share/i18n/locales/translit_neutral:13: non-symbolic character value should not be used
    /usr/share/i18n/locales/translit_neutral:14: non-symbolic character value should not be used
    /usr/share/i18n/locales/translit_neutral:15: non-symbolic character value should not be used
    /usr/share/i18n/locales/translit_neutral:16: non-symbolic character value should not be used
    /usr/share/i18n/locales/translit_neutral:17: non-symbolic character value should not be used
    LC_NAME: field `name_gen' not defined
    LC_NAME: field `name_mr' not defined
    LC_NAME: field `name_mrs' not defined
    LC_NAME: field `name_miss' not defined
    LC_NAME: field `name_ms' not defined
    LC_ADDRESS: field `country_name' not defined
    LC_ADDRESS: field `country_post' not defined
    LC_ADDRESS: field `country_car' not defined
    LC_ADDRESS: field `country_isbn' not defined
    LC_ADDRESS: field `lang_name' not defined
    LC_ADDRESS: field `lang_term' not defined
    LC_ADDRESS: field `lang_ab' not defined
    LC_IDENTIFICATION: field `audience' not defined
    LC_IDENTIFICATION: field `application' not defined
    LC_IDENTIFICATION: field `abbreviation' not defined
    LC_IDENTIFICATION: no identification for category `LC_MEASUREMENT'
    LC_CTYPE: table for class "upper": 1756 bytes
    LC_CTYPE: table for class "lower": 1756 bytes
    LC_CTYPE: table for class "alpha": 4320 bytes
    LC_CTYPE: table for class "digit": 600 bytes
    LC_CTYPE: table for class "xdigit": 600 bytes
    LC_CTYPE: table for class "space": 856 bytes
    LC_CTYPE: table for class "print": 5976 bytes
    LC_CTYPE: table for class "graph": 5976 bytes
    LC_CTYPE: table for class "blank": 856 bytes
    LC_CTYPE: table for class "cntrl": 664 bytes
    LC_CTYPE: table for class "punct": 4824 bytes
    LC_CTYPE: table for class "alnum": 4320 bytes
    LC_CTYPE: table for class "combining": 3152 bytes
    LC_CTYPE: table for class "combining_level3": 2832 bytes
    LC_CTYPE: table for map "toupper": 16924 bytes
    LC_CTYPE: table for map "tolower": 15388 bytes
    LC_CTYPE: table for map "totitle": 16924 bytes
    LC_CTYPE: table for width: 26712 bytes
    

    最佳答案

    因此,经过多一点挖掘,我发现添加 --quiet , 只会报告 致命 错误,让我可以毫无问题地编译 pt_BR 语言环境。

    关于docker - CentOS 7 Docker 镜像和语言环境编译,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30736238/

    相关文章:

    javascript - Internet Explorer 返回错误长度的字符串

    mysql - 通过 CentOS 命令行更改 MySQL 上的条目?

    linux - 如何使用 firewalld 记录对特定端口的连接拒绝?

    docker - Kubernetes消耗更多的内存,为什么?

    amazon-web-services - 如何使用 AWS、Docker、Nginx + Daphne 在生产中正确配置 Django Channels?

    java - TestContainers 框架无法访问 docker 守护进程

    python - Cython "ModuleNotFoundError"即使它只是在构建 docker 镜像时通过 requirements.txt 安装

    java - AcceptHeaderLocaleResolver 的 defaultLocale 不起作用

    java - Locale.setDefault() 安全吗?

    linux - Docker 运行错误 : "Thin Pool has free data blocks which is less than minimum required"