-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
18 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# 镜像输出内容乱码解决 | ||
|
||
在打包一个只能输出GB2312日志的程序的时候会遇到这个问题。 | ||
|
||
如何让控制台输出中文正常的内容。 | ||
|
||
修改dockerfile,增加如下环境变量。 | ||
|
||
```dockerfile | ||
ENV LANG zh_CN.GB2312 | ||
ENV LANGUAGE zh_CN.GB2312:zh | ||
ENV LC_ALL zh_CN.GB2312 | ||
``` | ||
这样打包好的镜像就可以正常输出中文内容了。 | ||
|
||
我这里使用的tail -F app.log 即使日志归档也能正常输出,不会停止。 |