Commit 69b63b70 by zhangxingmin

push

parent 5424d1b9
# 使用更小的 Alpine 基础镜像 # 基础镜像
FROM openjdk:8-jre-alpine FROM openjdk:8-jre-slim
# 维护人 # 维护人
LABEL maintainer="zxm<2060197959@qq.com>" LABEL maintainer="zxm<2060197959@qq.com>"
# 创建目录
RUN mkdir -p /home/app
# 安装 Alpine 版本的 LibreOffice(依赖更少)
RUN apk add --no-cache \
libreoffice \
libreoffice-writer \
libreoffice-lang-zh_cn \
ttf-dejavu \
ttf-droid \
ttf-freefont \
ttf-liberation \
font-noto-emoji \
font-noto-cjk \
&& fc-cache -f -v
# 设置环境变量 # 设置环境变量
ENV LANG=zh_CN.UTF-8 \ ENV LANG=zh_CN.UTF-8 \
LANGUAGE=zh_CN:zh \ LANGUAGE=zh_CN:zh \
LC_ALL=zh_CN.UTF-8 LC_ALL=zh_CN.UTF-8 \
DEBIAN_FRONTEND=noninteractive
# 1. 更新源(这层很少变化,缓存利用率高)
RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list && \
sed -i 's/security.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list
# 2. 更新包列表(单独一层)
RUN apt-get update
# 3. 安装字体(字体很少更新)
RUN apt-get install -y --no-install-recommends \
fonts-liberation \
fonts-dejavu-core \
fonts-wqy-microhei \
fonts-noto-cjk \
fontconfig \
locales && \
echo "zh_CN.UTF-8 UTF-8" >> /etc/locale.gen && \
locale-gen zh_CN.UTF-8 && \
fc-cache -f -v
# 4. 安装 LibreOffice 核心
RUN apt-get install -y --no-install-recommends \
libreoffice-core \
libreoffice-writer \
libreoffice-l10n-zh-cn
# 5. 清理
RUN apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# 创建目录
RUN mkdir -p /home/app
WORKDIR /home/app
# 拷贝项目jar # 6. 拷贝项目jar(这层经常变化,放在最后)
COPY target/yd-oss-api-1.0-SNAPSHOT-exec.jar /home/app/yd-oss-api.jar COPY target/yd-oss-api-1.0-SNAPSHOT-exec.jar /home/app/yd-oss-api.jar
ENTRYPOINT ["java", "-jar", "/home/app/yd-oss-api.jar"] ENTRYPOINT ["java", "-jar", "/home/app/yd-oss-api.jar"]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment