Dockerfile 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. FROM ubuntu:20.04
  2. MAINTAINER chenjh "842761733@qq.com"
  3. ADD server/target/kkFileView-*.tar.gz /opt/
  4. COPY fonts/* /usr/share/fonts/chinese/
  5. RUN echo "deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse\ndeb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse\ndeb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse\ndeb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse\ndeb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse\ndeb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse\ndeb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse\ndeb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse\ndeb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse\ndeb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse" > /etc/apt/sources.list &&\
  6. apt-get clean && apt-get update &&\
  7. apt-get install -y locales && apt-get install -y language-pack-zh-hans &&\
  8. localedef -i zh_CN -c -f UTF-8 -A /usr/share/locale/locale.alias zh_CN.UTF-8 && locale-gen zh_CN.UTF-8 &&\
  9. export DEBIAN_FRONTEND=noninteractive &&\
  10. apt-get install -y tzdata && ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime &&\
  11. apt-get install -y libxrender1 && apt-get install -y libxt6 && apt-get install -y libxext-dev && apt-get install -y libfreetype6-dev &&\
  12. apt-get install -y wget && apt-get install -y ttf-mscorefonts-installer && apt-get install -y fontconfig &&\
  13. apt-get install ttf-wqy-microhei &&\
  14. apt-get install ttf-wqy-zenhei &&\
  15. apt-get install xfonts-wqy &&\
  16. cd /tmp &&\
  17. wget https://kkfileview.keking.cn/server-jre-8u251-linux-x64.tar.gz &&\
  18. tar -zxf /tmp/server-jre-8u251-linux-x64.tar.gz && mv /tmp/jdk1.8.0_251 /usr/local/ &&\
  19. # 安装 OpenOffice
  20. # wget https://kkfileview.keking.cn/Apache_OpenOffice_4.1.6_Linux_x86-64_install-deb_zh-CN.tar.gz -cO openoffice_deb.tar.gz &&\
  21. # tar -zxf /tmp/openoffice_deb.tar.gz && cd /tmp/zh-CN/DEBS &&\
  22. # dpkg -i *.deb && dpkg -i desktop-integration/openoffice4.1-debian-menus_4.1.6-9790_all.deb &&\
  23. # 安装 libreoffice
  24. apt-get install -y libxinerama1 libcairo2 libcups2 libx11-xcb1 &&\
  25. wget https://kkfileview.keking.cn/LibreOffice_7.1.4_Linux_x86-64_deb.tar.gz -cO libreoffice_deb.tar.gz &&\
  26. tar -zxf /tmp/libreoffice_deb.tar.gz && cd /tmp/LibreOffice_7.1.4.2_Linux_x86-64_deb/DEBS &&\
  27. dpkg -i *.deb &&\
  28. rm -rf /tmp/* && rm -rf /var/lib/apt/lists/* &&\
  29. cd /usr/share/fonts/chinese &&\
  30. mkfontscale &&\
  31. mkfontdir &&\
  32. fc-cache -fv
  33. ENV JAVA_HOME /usr/local/jdk1.8.0_251
  34. ENV CLASSPATH $JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
  35. ENV PATH $PATH:$JAVA_HOME/bin
  36. ENV LANG zh_CN.UTF-8
  37. ENV LC_ALL zh_CN.UTF-8
  38. ENV KKFILEVIEW_BIN_FOLDER /opt/kkFileView-4.1.0-SNAPSHOT/bin
  39. ENTRYPOINT ["java","-Dfile.encoding=UTF-8","-Dspring.config.location=/opt/kkFileView-4.1.0-SNAPSHOT/config/application.properties","-jar","/opt/kkFileView-4.1.0-SNAPSHOT/bin/kkFileView-4.1.0-SNAPSHOT.jar"]