zhangdaiscott 0ad56cff5f Docker镜像去掉yum安装glibc-langpack-en,改用基础镜像自带的C.UTF-8 locale
构建时 yum 安装 glibc-langpack-en/glibc-common 受网络影响经常超过10分钟。
java:17-anolis、java:21-anolis 基础镜像均自带 C.utf8 locale,
将 LANG/LC_ALL 改为 C.UTF-8 后 file.encoding、sun.jnu.encoding 均为 UTF-8,
中文日志与中文文件名正常,无需再安装语言包。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 22:10:59 -04:00

21 lines
709 B
Docker
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

FROM registry.cn-hangzhou.aliyuncs.com/dockerhub_mirror/java:17-anolis
MAINTAINER jeecgos@163.com
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
# 解决中文乱码:基础镜像自带 C.utf8 locale,直接使用,无需 yum 安装 glibc-langpack-en(避免构建时网络慢)
ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8
ENV JAVA_TOOL_OPTIONS="-Dfile.encoding=UTF-8"
RUN mkdir -p /jeecg-cloud-gateway
WORKDIR /jeecg-cloud-gateway
EXPOSE 9999
ADD ./target/jeecg-cloud-gateway-3.9.5.jar ./
# 去掉sleep 100,直接启动(docker-compose下由command覆盖为轮询nacos等system注册后再启动)
CMD exec java -Djava.security.egd=file:/dev/./urandom -jar jeecg-cloud-gateway-3.9.5.jar