Encoding Problems when running an app in docker (Python, Java, Ruby, …) with Ubuntu Containers (ascii, utf-8)

后端 未结 3 810
慢半拍i
慢半拍i 2020-12-29 05:19

On my own PC the application runs nice, but when it gets deployed into docker, it fails because of invalid characters.

I am using the ubuntu:lastest con

3条回答
  •  隐瞒了意图╮
    2020-12-29 05:36

    I tried the above solution and found that the locale-gen command is not available inside my docker.

    so add this line above the RUN command or add it in.

    RUN apt-get update && apt-get install -y locales && locale-gen en_US.UTF-8
    

    this will now work.

    and second ENV LC_ALL en_US.UTF-8 is enough to set most of the variable but it left with the two vacant so that's why we need all 3 to set.

提交回复
热议问题