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
729 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:21-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-nacos
WORKDIR /jeecg-cloud-nacos
EXPOSE 8848 18080
ADD ./target/jeecg-cloud-nacos-3.9.5.jar ./
# 去掉sleep 30,容器启动后立即拉起应用(MySQL就绪由docker-compose的healthcheck+depends_on: service_healthy保证)
CMD exec java -Djava.security.egd=file:/dev/./urandom -jar jeecg-cloud-nacos-3.9.5.jar