Merge pull request #581 from wayne-cheng/optimize-dockerfile
优化Dockerfile,支持真正的跨平台构建镜像pull/307/head
commit
782509376c
@ -1,38 +1,31 @@
|
|||||||
FROM ubuntu:20.04
|
FROM ubuntu:24.04
|
||||||
MAINTAINER chenjh "842761733@qq.com"
|
|
||||||
# 内置一些常用的中文字体,避免普遍性乱码
|
RUN sed -i 's@//.*archive.ubuntu.com@//mirrors.aliyun.com@g' /etc/apt/sources.list.d/ubuntu.sources &&\
|
||||||
COPY fonts/* /usr/share/fonts/chinese/
|
sed -i 's@//security.ubuntu.com@//mirrors.aliyun.com@g' /etc/apt/sources.list.d/ubuntu.sources &&\
|
||||||
RUN apt-get clean && apt-get update &&\
|
sed -i 's@//ports.ubuntu.com@//mirrors.aliyun.com@g' /etc/apt/sources.list.d/ubuntu.sources &&\
|
||||||
sed -i 's/http:\/\/archive.ubuntu.com/https:\/\/mirrors.aliyun.com/g' /etc/apt/sources.list &&\
|
apt-get update &&\
|
||||||
sed -i 's/# deb/deb/g' /etc/apt/sources.list &&\
|
|
||||||
apt-get install -y --reinstall ca-certificates &&\
|
|
||||||
apt-get clean && apt-get update &&\
|
|
||||||
apt-get install -y locales 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 &&\
|
|
||||||
export DEBIAN_FRONTEND=noninteractive &&\
|
export DEBIAN_FRONTEND=noninteractive &&\
|
||||||
apt-get install -y tzdata && ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime &&\
|
apt-get install -y --no-install-recommends openjdk-8-jre tzdata locales xfonts-utils fontconfig libreoffice-nogui &&\
|
||||||
apt-get install -y fontconfig ttf-mscorefonts-installer ttf-wqy-microhei ttf-wqy-zenhei xfonts-wqy &&\
|
echo 'Asia/Shanghai' > /etc/timezone &&\
|
||||||
apt-get install -y wget &&\
|
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime &&\
|
||||||
cd /tmp &&\
|
localedef -i zh_CN -c -f UTF-8 -A /usr/share/locale/locale.alias zh_CN.UTF-8 &&\
|
||||||
wget https://kkview.cn/resource/server-jre-8u251-linux-x64.tar.gz &&\
|
locale-gen zh_CN.UTF-8 &&\
|
||||||
tar -zxf /tmp/server-jre-8u251-linux-x64.tar.gz && mv /tmp/jdk1.8.0_251 /usr/local/ &&\
|
# 安装微软字体
|
||||||
|
# apt-get install -y --no-install-recommends ttf-mscorefonts-installer &&\
|
||||||
|
# 安装文泉驿字体
|
||||||
|
# apt-get install -y --no-install-recommends ttf-wqy-microhei ttf-wqy-zenhei xfonts-wqy &&\
|
||||||
|
# 清理临时文件
|
||||||
|
apt-get autoremove -y &&\
|
||||||
|
apt-get clean &&\
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# 安装 libreoffice
|
# 内置一些常用的中文字体,避免普遍性乱码. 建议安装思源字体 https://zh-cn.libreoffice.org/download/fonts/
|
||||||
apt-get install -y libxrender1 libxinerama1 libxt6 libxext-dev libfreetype6-dev libcairo2 libcups2 libx11-xcb1 libnss3 &&\
|
ADD fonts/* /usr/share/fonts/chinese/
|
||||||
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 &&\
|
|
||||||
tar -zxf /tmp/libreoffice_deb.tar.gz && cd /tmp/LibreOffice_7.5.3.2_Linux_x86-64_deb/DEBS &&\
|
|
||||||
dpkg -i *.deb &&\
|
|
||||||
|
|
||||||
# 清理临时文件
|
RUN cd /usr/share/fonts/chinese &&\
|
||||||
rm -rf /tmp/* && rm -rf /var/lib/apt/lists/* &&\
|
# 安装字体
|
||||||
cd /usr/share/fonts/chinese &&\
|
|
||||||
mkfontscale &&\
|
mkfontscale &&\
|
||||||
mkfontdir &&\
|
mkfontdir &&\
|
||||||
fc-cache -fv
|
fc-cache -fv
|
||||||
|
|
||||||
ENV JAVA_HOME /usr/local/jdk1.8.0_251
|
ENV LANG=zh_CN.UTF-8 LC_ALL=zh_CN.UTF-8
|
||||||
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
|
|
||||||
CMD ["/bin/bash"]
|
|
||||||
|
Loading…
Reference in new issue