docker容器出现编码错误

容器运行出现 UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-2: ordinal not in range(256) 问题
原因是打印的内容有中文,编码出现问题
Dockerfile中,添加一行,设置环境变量,重新构建镜像,启动容器即可解决

ENV LC_ALL=C.UTF-8
posted @ 2023-08-08 12:23  Sincere_Ye  阅读(72)  评论(0编辑  收藏  举报