Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yd-oss
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xingmin
yd-oss
Commits
70c04f5c
Commit
70c04f5c
authored
Oct 17, 2025
by
zhangxingmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
push
parent
74d7f928
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
2 deletions
+36
-2
yd-oss-api/Dockerfile
+36
-2
No files found.
yd-oss-api/Dockerfile
View file @
70c04f5c
# 基础镜像
FROM
openjdk:8-jre-slim
# 使用 alpine 以获得更小的镜像
# 使用 alpine 以获得更小的镜像
FROM
openjdk:8-jdk-alpine
FROM
openjdk:8-jdk-alpine
# 维护人
LABEL
maintainer="zxm<2060197959@qq.com>"
LABEL
maintainer="zxm<2060197959@qq.com>"
# 设置环境变量
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
TZ=Asia/Shanghai
TZ=Asia/Shanghai
# 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
\
# 安装基础依赖和字体(alpine 使用 apk)
# 安装基础依赖和字体(alpine 使用 apk)
RUN
apk add
--no-cache
\
RUN
apk add
--no-cache
\
tzdata
\
tzdata
\
fontconfig
\
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
ttf-dejavu \
ttf-dejavu \
ttf-liberation \
ttf-liberation \
ttf-wqy-microhei \
ttf-wqy-microhei \
...
@@ -20,9 +48,16 @@ RUN apk add --no-cache \
...
@@ -20,9 +48,16 @@ RUN apk add --no-cache \
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/localtime && \
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/localtime && \
mkdir -p /home/app
mkdir -p /home/app
# 5. 清理
RUN
apt-get clean
&&
\
rm
-rf
/var/lib/apt/lists/
*
/tmp/
*
/var/tmp/
*
# 创建目录
RUN
mkdir
-p
/home/app
WORKDIR
/home/app
WORKDIR
/home/app
# 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"]
EXPOSE
9106
EXPOSE
9106
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment