wkhtmltox安装基于centos镜像
安装脚本
- 安装docker环境
docker pull centos:7
docker run -d centos:7
docker exec -it xxx bash
- 进入容器安装
- 复制软件
https://wkhtmltopdf.org/downloads.html
docker cp wkhtmltox-0.12.6-1.centos7.x86_64.rpm xxx:/
## 复制中文字体包...
- 安装脚本
# 镜像源
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo
yum makecache fast
# 时区
cp -f /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
# 安装java
yum install -y java-1.8.0-openjdk-devel.x86_64
# 前置软件
yum -y install unzip fontconfig mkfontscale libX11 libXext libXrender xorg-x11-fonts-75dpi xorg-x11-fonts-Type1 openssl libjpeg*
# 安装wkhtmltox
rpm -ivh --force wkhtmltox-0.12.6-1.centos7.x86_64.rpm
# 安装字体
mkdir -p /usr/share/fonts/my_fonts
cd /usr/share/fonts/my_fonts
mkfontscale
fc-list :lang=zh