Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 440b803

Browse files
gitchenjhklboke
authored andcommitted
新增Docker构建
1 parent fb7cdfb commit 440b803

File tree

4 files changed

+61
-2
lines changed

4 files changed

+61
-2
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@ nbdist/
3838
/.temfile
3939
.temfile
4040
convertedFile/
41-
jodconverter-web/src/main/file
42-
jodconverter-web/src/main/cache
41+
jodconverter-web/src/main/cache/
42+
jodconverter-web/src/main/file/

Dockerfile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
FROM centos:centos7.6.1810
2+
MAINTAINER chenjh "[email protected]"
3+
ADD jodconverter-web/target/kkFileView-*.tar.gz /opt/
4+
COPY fonts/* /usr/share/fonts/
5+
RUN yum install -y kde-l10n-Chinese &&\
6+
yum install -y glibc-common &&\
7+
yum install -y fontconfig &&\
8+
yum install -y mkfontscale &&\
9+
localedef -c -f UTF-8 -i zh_CN zh_CN.utf8 &&\
10+
export LANG=zh_CN.UTF-8 &&\
11+
echo "export LANG=zh_CN.UTF-8" >> /etc/locale.conf &&\
12+
LANG="zh_CN.UTF-8" &&\
13+
yum install -y java-1.8.0-openjdk.x86_64 &&\
14+
yum install -y wget &&\
15+
yum install -y libXext.x86_64 &&\
16+
yum groupinstall -y "X Window System" &&\
17+
cd /tmp &&\
18+
wget https://iweb.dl.sourceforge.net/project/openofficeorg.mirror/4.1.6/binaries/zh-CN/Apache_OpenOffice_4.1.6_Linux_x86-64_install-rpm_zh-CN.tar.gz -cO openoffice_rpm.tar.gz &&\
19+
tar zxf /tmp/openoffice_rpm.tar.gz &&\
20+
cd /tmp/zh-CN/RPMS &&\
21+
rpm -Uvih *.rpm &&\
22+
rpm -Uvih desktop-integration/openoffice4.1.6-redhat-menus-4.1.6-9790.noarch.rpm &&\
23+
rm -f /tmp/openoffice_rpm.tar.gz &&\
24+
rm -rf /tmp/zh-CN &&\
25+
cd /usr/share/fonts &&\
26+
mkfontscale &&\
27+
mkfontdir &&\
28+
fc-cache -fv
29+
ENV LC_ALL zh_CN.UTF-8
30+
CMD sh /opt/kkFileView-2.1.0-SNAPSHOT/bin/docker-startup.sh

fonts/.gitkeep

Whitespace-only changes.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
DIR_HOME=("/opt/openoffice.org3" "/opt/libreoffice" "/opt/openoffice4" "/usr/lib/openoffice" "/usr/lib/libreoffice")
3+
FLAG=
4+
OFFICE_HOME=
5+
KKFILEVIEW_BIN_FOLDER=$(cd "$(dirname "$0")";pwd)
6+
export KKFILEVIEW_BIN_FOLDER=$KKFILEVIEW_BIN_FOLDER
7+
cd $KKFILEVIEW_BIN_FOLDER
8+
echo "Using KKFILEVIEW_BIN_FOLDER $KKFILEVIEW_BIN_FOLDER"
9+
grep 'office\.home' ../conf/application.properties | grep '!^#'
10+
if [ $? -eq 0 ]; then
11+
echo "Using customized office.home"
12+
else
13+
for i in ${DIR_HOME[@]}
14+
do
15+
if [ -f $i"/program/soffice.bin" ]; then
16+
FLAG=true
17+
OFFICE_HOME=${i}
18+
break
19+
fi
20+
done
21+
if [ ! -n "${FLAG}" ]; then
22+
echo "Installing OpenOffice"
23+
sh ../script/install.sh
24+
else
25+
echo "Detected office component has been installed in $OFFICE_HOME"
26+
fi
27+
fi
28+
echo "Starting kkFileView..."
29+
java -Dsun.java2d.cmm=sun.java2d.cmm.kcms.KcmsServiceProvider -Dspring.config.location=../conf/application.properties -jar kkFileView-2.1.0-SNAPSHOT.jar

0 commit comments

Comments
 (0)