Skip to content

Commit

Permalink
发布博客,时间:2024/12/26 14:56:24
Browse files Browse the repository at this point in the history
  • Loading branch information
whp98 committed Dec 26, 2024
1 parent 79f349c commit b889c32
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# 目录
- [容器技术](./容器技术/)
- [About](./public/public.md)
- [Rust语言](./Rust语言/)
- [社会认知](./社会认知/)
- [后端开发](./后端开发/)
- [AI相关](./AI相关/)
- [容器技术](./容器技术/)
- [Linux系统](./Linux系统/)
- [开发工具技巧](./开发工具技巧/)
- [SVN版本管理](./SVN版本管理/)
Expand Down
1 change: 1 addition & 0 deletions docs/容器技术/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# 容器技术
- [镜像输出内容乱码解决](./镜像输出内容乱码解决.md)
- [ubuntu docker使用nvidia显卡跑ai](./docker使用nvidia显卡跑ai.md)
- [docker-compose中如何访问宿主机的网络(设置代理)](./docker-compose中如何访问宿主机的网络.md)
- [docker-compose设置拉取策略](./docker-compose设置拉取策略.md)
Expand Down
16 changes: 16 additions & 0 deletions docs/容器技术/镜像输出内容乱码解决.md
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 即使日志归档也能正常输出,不会停止。

0 comments on commit b889c32

Please sign in to comment.