Răsfoiți Sursa

生成图片测试

zhangheng 3 ani în urmă
părinte
comite
5053719fb6
1 a modificat fișierele cu 10 adăugiri și 0 ștergeri
  1. 10 0
      server/Dockerfile

+ 10 - 0
server/Dockerfile

@@ -3,6 +3,11 @@ FROM anapsix/alpine-java:8_server-jre_unlimited
 # 作者
 MAINTAINER zhangheng
 
+# 给selenium chrome安装中文字体
+# 方式chrome 截图中文出现方块,显示中文出错
+RUN apt-get update \
+    &&apt-get -y install xfonts-wqy ttf-wqy-microhei
+
 # 安装chromedirver
 # Install Chrome WebDriver
 RUN CHROMEDRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE` && \
@@ -13,6 +18,11 @@ RUN CHROMEDRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RE
     chmod +x /opt/chromedriver-$CHROMEDRIVER_VERSION/chromedriver && \
     ln -fs /opt/chromedriver-$CHROMEDRIVER_VERSION/chromedriver /usr/local/bin/chromedriver
 
+# 下载 Chrome deb
+RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
+# 安装chrome浏览器
+RUN dpkg -i google-chrome-stable_current_amd64.deb; apt-get -fy install
+
 ARG workdir=/app
 VOLUME ${workdir}
 WORKDIR ${workdir}