Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
slm-fileview
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jenkins
slm-fileview
Commits
e37783f8
Commit
e37783f8
authored
Nov 26, 2021
by
yongshengLuo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Dockerfile
parent
80aebf15
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
42 deletions
+30
-42
Dockerfile
Dockerfile
+30
-42
No files found.
Dockerfile
View file @
e37783f8
FROM
ubuntu:20.04
MAINTAINER
chenjh "842761733@qq.com"
ADD
server/target/kkFileView-*.tar.gz /opt/
COPY
fonts/* /usr/share/fonts/chinese/
RUN
echo
"deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
\n
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
\n
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
\n
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
\n
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
\n
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
\n
deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
\n
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
\n
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
\n
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse"
>
/etc/apt/sources.list
&&
\
apt-get clean
&&
apt-get update
&&
\
apt-get
install
-y
locales
&&
apt-get
install
-y
language-pack-zh-hans
&&
\
localedef
-i
zh_CN
-c
-f
UTF-8
-A
/usr/share/locale/locale.alias zh_CN.UTF-8
&&
locale-gen zh_CN.UTF-8
&&
\
apt-get
install
-y
tzdata
&&
ln
-sf
/usr/share/zoneinfo/Asia/Shanghai /etc/localtime
&&
\
apt-get
install
-y
libxrender1
&&
apt-get
install
-y
libxt6
&&
apt-get
install
-y
libxext-dev
&&
apt-get
install
-y
libfreetype6-dev
&&
\
apt-get
install
-y
wget
&&
apt-get
install
-y
ttf-mscorefonts-installer
&&
apt-get
install
-y
fontconfig
&&
\
apt-get
install
ttf-wqy-microhei
&&
\
apt-get
install
ttf-wqy-zenhei
&&
\
apt-get
install
xfonts-wqy
&&
\
cd
/tmp
&&
\
wget https://kkfileview.keking.cn/server-jre-8u251-linux-x64.tar.gz
&&
\
tar
-zxf
/tmp/server-jre-8u251-linux-x64.tar.gz
&&
mv
/tmp/jdk1.8.0_251 /usr/local/
&&
\
# 安装 OpenOffice
# wget https://kkfileview.keking.cn/Apache_OpenOffice_4.1.6_Linux_x86-64_install-deb_zh-CN.tar.gz -cO openoffice_deb.tar.gz &&\
# tar -zxf /tmp/openoffice_deb.tar.gz && cd /tmp/zh-CN/DEBS &&\
# dpkg -i *.deb && dpkg -i desktop-integration/openoffice4.1-debian-menus_4.1.6-9790_all.deb &&\
# 安装 libreoffice
apt-get install -y libxinerama1 libcairo2 libcups2 libx11-xcb1 &&\
wget https://kkfileview.keking.cn/LibreOffice_7.1.4_Linux_x86-64_deb.tar.gz -cO libreoffice_deb.tar.gz &&\
tar -zxf /tmp/libreoffice_deb.tar.gz && cd /tmp/LibreOffice_7.1.4.2_Linux_x86-64_deb/DEBS &&\
dpkg -i *.deb &&\
rm -rf /tmp/* && rm -rf /var/lib/apt/lists/* &&\
cd /usr/share/fonts/chinese &&\
mkfontscale &&\
mkfontdir &&\
fc-cache -fv
ENV
JAVA_HOME /usr/local/jdk1.8.0_251
ENV
CLASSPATH $JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
ENV
PATH $PATH:$JAVA_HOME/bin
ENV
LANG zh_CN.UTF-8
ENV
LC_ALL zh_CN.UTF-8
ENV
KKFILEVIEW_BIN_FOLDER /opt/kkFileView-4.0.0/bin
ENTRYPOINT
["java","-Dfile.encoding=UTF-8","-Dspring.config.location=/opt/kkFileView-4.0.0/config/application.properties","-jar","/opt/kkFileView-4.0.0/bin/kkFileView-4.0.0.jar"]
\ No newline at end of file
FROM
swr.cn-south-1.myhuaweicloud.com/build-needs/arm64v8/wkhtmltopdf-ffmpeg-jdk8:latest
MAINTAINER
tuotuopz01@163.com
EXPOSE
6001
#ARG用于builld --build-arg 赋值,多个ARG对应多个--build-arg
ARG
APP_NAME
ARG
JAVA_OPTS
ENV
TZ=Asia/Shanghai
#语言环境,解决相互调用出现中文乱码
ENV
LANG C.UTF-8
ENV
APP_NAME $APP_NAME
ENV
JAVA_OPTS $JAVA_OPTS
RUN
mkdir
-p
/app-tmp
RUN
ln
-sf
/usr/share/zoneinfo/
$TZ
/etc/localtime
&&
echo
$TZ
>
/etc/timezone
WORKDIR
/app-tmp
RUN
echo
$APP_NAME
ADD
./data /data
ADD
./${APP_NAME}/target/*.jar ./${APP_NAME}.jar
RUN
echo
"ENTRYPOINT java -server
$JAVA_OPTS
-jar
${
APP_NAME
}
.jar"
#注意因为要传递参数,ENTRYPOINT要选择shell模式,而非exec模式
#ENTRYPOINT和CMD因为其是在容器启动的时候执行,所以无法加载ARG,但是可以拿到ENV,所以ARG和ENV一般都是配合使用
ENTRYPOINT
java -server $JAVA_OPTS -jar ${APP_NAME}.jar
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