【docker】中文无法显示输入等问题解决方法

every blog every motto: You can do more than you think.
csdn: https://blog.csdn.net/weixin_39190382?type=blog
ID: 胡侃有料

0. 前言

docker 路径中文不显示,无法输入中文问题解决方法

1. 解决方法

1.1 临时解决

打开etc/profile文件,末尾添加

export LANG=C.UTF-8

执行如下,使文件生效

source /etc/profile

进入容器时,指定编码方式


docker exec -it my_container env LANG=C.UTF-8 /bin/bash

1.2 永久解决办法

在Dockerfile中添加

ENV LANG C.UTF-8

参考

[1] https://blog.csdn.net/weixin_43220532/article/details/114007987
[2] https://blog.csdn.net/zimojiang/article/details/126116449#:~:t

猜你喜欢

转载自blog.csdn.net/weixin_39190382/article/details/132451385