问题描述
下面是我正在使用的 dockerfile
Below is the dockerfile that I am using
FROM python:3.6-slim
RUN apt update
RUN apt install poppler-utils -y
RUN apt install git -y
WORKDIR /src/
ADD . /src
CMD tail -f /dev/null
当我使用 pdftocairo -v 检查 poppler 的版本时,我得到 0.71 作为 poppler 版本.我需要使用 python baseimage 安装特定版本(0.82)的 poppler
when I check the version of poppler using pdftocairo -v , I get 0.71 as the poppler version. I need to install specific version(0.82) of poppler with a python baseimage
推荐答案
在撰写此答案时,最新版本的 Poppler 是 20.08.0.如果你想在你的 Docker 镜像中使用这个版本,你可以这样做:
At the time of writing this answer, the latest version of the Poppler is 20.08.0. If you want to use this version in your Docker image, you can do it as follows:
创建一个包含以下内容的 Dockerfile
Create a Dockerfile with the following content
FROM python:3.8-slim-buster
RUN apt-get update && apt-get install wget build-essential cmake libfreetype6-dev pkg-config libfontconfig-dev libjpeg-dev libopenjp2-7-dev -y
RUN wget https://poppler.freedesktop.org/poppler-data-0.4.9.tar.gz \
&& tar -xf poppler-data-0.4.9.tar.gz \
&& cd poppler-data-0.4.9 \
&& make install \
&& cd .. \
&& wget https://poppler.freedesktop.org/poppler-20.08.0.tar.xz \
&& tar -xf poppler-20.08.0.tar.xz \
&& cd poppler-20.08.0 \
&& mkdir build \
&& cd build \
&& cmake .. \
&& make \
&& make install \
&& ldconfig
CMD tail -f /dev/null
构建并运行您的映像
Build and run your image
docker build -t milanhlinak/poppler .
docker run --name poppler milanhlinak/poppler
验证是否安装了 Poppler
Verify that Poppler was installed
PS C:\Users\Milan\poppler-docker> docker exec -it poppler pdftotext -v
pdftotext version 20.08.0
Copyright 2005-2020 The Poppler Developers - http://poppler.freedesktop.org
Copyright 1996-2011 Glyph & Cog, LLC
您还可以查看https://hub.docker.com/r/milanhlinak/poppler/
这篇关于在 docker 中安装 0.82 版本的 Poppler utils的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!