Skip to content

Docker images are not properly setting locale #1305

@ju2wheels

Description

@ju2wheels

We get the following warning out scalyr from the 2.2.17-alpine image:

Detected a non UTF-8 locale (unknown) being used. You are strongly encouraged to set the locale / coding for the agent process to UTF-8. Otherwise things won't work when trying to monitor files with non-ascii content or non-ascii characters in the log file names. On Linux you can do that by setting LANG and LC_ALL environment variable: e.g. export LC_ALL=en_US.UTF-8.

IMO this should be baked into the image (especially if there are any compiled components/extensions as they would have to be set before compiling C that may leverage locales).

For example on Debian/Ubuntu base there is the locales and locales-all packages and the following env vars required to make this work:

ENV LANG                    "en_US.UTF-8"
ENV LANGUAGE                "en_US.UTF-8"
ENV LC_ALL                  "en_US.UTF-8"

Is the expectation that we should be setting these after the fact?

[edit] It looks like 2.1.40-alpine had this correctly set as ENV LANG=C.UTF-8 and then it was removed in subsequent releases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions