Dockerfile 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. FROM ubuntu:20.04
  2. MAINTAINER chenjh "842761733@qq.com"
  3. # 内置一些常用的中文字体,避免普遍性乱码
  4. COPY fonts/* /usr/share/fonts/chinese/
  5. COPY target/kkFileView-4.4.0-SNAPSHOT.jar file-preview.jar
  6. EXPOSE 8012
  7. RUN apt-get clean && apt-get update &&\
  8. sed -i 's/http:\/\/archive.ubuntu.com/https:\/\/mirrors.aliyun.com/g' /etc/apt/sources.list &&\
  9. sed -i 's/# deb/deb/g' /etc/apt/sources.list &&\
  10. apt-get install -y --reinstall ca-certificates &&\
  11. apt-get clean && apt-get update &&\
  12. apt-get install -y locales language-pack-zh-hans &&\
  13. localedef -i zh_CN -c -f UTF-8 -A /usr/share/locale/locale.alias zh_CN.UTF-8 && locale-gen zh_CN.UTF-8 &&\
  14. export DEBIAN_FRONTEND=noninteractive &&\
  15. apt-get install -y tzdata && ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime &&\
  16. apt-get install -y fontconfig ttf-mscorefonts-installer ttf-wqy-microhei ttf-wqy-zenhei xfonts-wqy &&\
  17. apt-get install -y wget &&\
  18. cd /tmp &&\
  19. wget https://kkview.cn/resource/server-jre-8u251-linux-x64.tar.gz &&\
  20. tar -zxf /tmp/server-jre-8u251-linux-x64.tar.gz && mv /tmp/jdk1.8.0_251 /usr/local/ &&\
  21. # 安装 libreoffice
  22. apt-get install -y libxrender1 libxinerama1 libxt6 libxext-dev libfreetype6-dev libcairo2 libcups2 libx11-xcb1 libnss3 &&\
  23. wget https://downloadarchive.documentfoundation.org/libreoffice/old/7.5.3.2/deb/x86_64/LibreOffice_7.5.3.2_Linux_x86-64_deb.tar.gz -cO libreoffice_deb.tar.gz &&\
  24. tar -zxf /tmp/libreoffice_deb.tar.gz && cd /tmp/LibreOffice_7.5.3.2_Linux_x86-64_deb/DEBS &&\
  25. dpkg -i *.deb &&\
  26. # 清理临时文件
  27. rm -rf /tmp/* && rm -rf /var/lib/apt/lists/* &&\
  28. cd /usr/share/fonts/chinese &&\
  29. mkfontscale &&\
  30. mkfontdir &&\
  31. fc-cache -fv
  32. ENV JAVA_HOME /usr/local/jdk1.8.0_251
  33. ENV CLASSPATH $JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
  34. ENV PATH $PATH:$JAVA_HOME/bin
  35. ENV LANG zh_CN.UTF-8
  36. ENV LC_ALL zh_CN.UTF-8
  37. CMD ["/bin/bash"]