0

我正在尝试升级我正在使用的 pdf2htmlEX 版本,并在 docker 映像构建期间遇到各种错误。

这是我的码头文件:

RUN dpkg --configure -a 
RUN apt-get clean
RUN apt-get update 
RUN apt-get install -f -y python3
RUN apt-get install dialog apt-utils -y
RUN apt-get install -f -y python3-pip 
RUN apt-get install -f -y python3-setuptools 
RUN apt-get install -f -y wget export AWS_PROFILE=chegg-aws-shared-nonprod

RUN apt-get install -f -y poppler-utils 
RUN apt-get install -f -y jq 
RUN apt-get install -f -y pdftk 
RUN apt-get install -f -y ffmpeg 
RUN apt-get install -f -y build-essential 
RUN apt-get install -f -y cmake 
RUN apt-get install -f -y make
RUN apt-get install -f -y libpoppler-private-dev
RUN apt-get install -f -y pkg-config
RUN apt-get install -f -y gcc
RUN apt-get install -f -y g++
RUN apt-get install -f -y libcairo-dev
RUN apt-get install -f -y libspiro-dev
RUN apt-get install -f -y libpng-dev
RUN apt-get install -f -y libjpeg-dev

RUN apt-get install -f -y libpoppler-dev
RUN apt-get install -f -y libpango1.0-dev
RUN apt-get install -f -y poppler-data
RUN apt-get install -f -y openjdk-8-jre-headless

RUN apt-get install -f -y libfontforge-dev
RUN pip3 install --upgrade pip \
    && apt-get clean
RUN pip3 --no-cache-dir install --upgrade awscli
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
#RUN apt-get install -f -y libpaper1
#RUN apt-get --purge remove -f -y libpaper1:amd64 libpaper-utils unattended-upgrades libgs9:amd64 ghostscript
#RUN apt-get clean -y
#RUN apt-get update  -y && apt-get upgrade -y
#RUN apt autoremove -y
#RUN apt-get install -f -y ghostscript --option=Dpkg::Options::=--force-all
 
WORKDIR /tmp

# COPY lib/cairo-1.17.4.tar.xz /tmp
COPY lib/cairo-1.16.0.tar.xz /tmp
RUN wget https://cairographics.org/releases/pixman-0.36.0.tar.gz
RUN tar xvfz pixman-0.36.0.tar.gz
RUN ./pixman-0.36.0/configure && make && make install

RUN tar -xf cairo-1.16.0.tar.xz
RUN ./cairo-1.16.0/configure --prefix=/tmp/cairob && make && make install
RUN cp -r /tmp/cairob/lib/* /usr/lib/x86_64-linux-gnu/


COPY lib/poppler-poppler-0.81.0.tar.gz /tmp
RUN tar -xvf poppler-poppler-0.81.0.tar.gz
WORKDIR /tmp/poppler-poppler-0.81.0
# compile and install the poppler for debian..
RUN mkdir build && cd build && cmake  -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -L$HOME/prefix/lib -I$HOME/prefix/include -DTESTDATADIR=$PWD/testfiles -DENABLE_XPDF_HEADERS=ON  .. && make && make install

WORKDIR /tmp

COPY lib/pdf2htmlEX-0.18.7-poppler-0.81.0.tar.gz /tmp
RUN tar -xf /tmp/pdf2htmlEX-0.18.7-poppler-0.81.0.tar.gz
WORKDIR /tmp/pdf2htmlEX-0.18.7-poppler-0.81.0
# get the created poopler config file pass it as agrument to pdf2htmlEX
COPY ./includes/ /tmp/pdf2htmlEX-0.18.7-poppler-0.81.0/3rdparty/
RUN mkdir -p /tmp/pdf2htmlEX-0.18.7-poppler-0.81.0/3rdparty/poppler
RUN mkdir -p /tmp/pdf2htmlEX-0.18.7-poppler-0.81.0/3rdparty/poppler/git

RUN cp /tmp/poppler-poppler-0.81.0/build/poppler/poppler-config.h /tmp/pdf2htmlEX-0.18.7-poppler-0.81.0/3rdparty/poppler/git/

RUN ./dobuild
RUN ./doinstall

在输出中,我看到多个 docker build 错误,与 poppler 编译有关。

 > [61/62] RUN ./dobuild:
#66 0.627 -- The C compiler identification is GNU 6.3.0
#66 0.775 -- The CXX compiler identification is GNU 6.3.0
#66 0.787 -- Check for working C compiler: /usr/bin/cc
#66 0.867 -- Check for working C compiler: /usr/bin/cc -- works
#66 0.870 -- Detecting C compiler ABI info
#66 0.940 -- Detecting C compiler ABI info - done
#66 0.949 -- Detecting C compile features
#66 1.134 -- Detecting C compile features - done
#66 1.139 -- Check for working CXX compiler: /usr/bin/c++
#66 1.231 -- Check for working CXX compiler: /usr/bin/c++ -- works
#66 1.232 -- Detecting CXX compiler ABI info
#66 1.352 -- Detecting CXX compiler ABI info - done
#66 1.362 -- Detecting CXX compile features
#66 1.696 -- Detecting CXX compile features - done
#66 1.708 -- Found PkgConfig: /usr/bin/pkg-config (found version "0.29") 
#66 1.710 -- Checking for module 'poppler>=0.25.0'
#66 1.737 --   Found poppler, version 0.81.0
#66 1.767 -- Checking for module 'cairo>=1.10.0'
#66 1.786 --   Found cairo, version 1.16.0
#66 1.820 Trying to locate cairo-svg...
#66 1.843 -- Found Freetype: /usr/lib/x86_64-linux-gnu/libfreetype.so (found version "2.6.3") 
#66 1.844 -- Checking for module 'libfontforge>=2.0.0'
#66 1.861 --   Found libfontforge, version 2.0.20161004
#66 1.900 -- Performing Test CXX0X_SUPPORT
#66 2.097 -- Performing Test CXX0X_SUPPORT - Success
#66 2.127 -- Configuring done
#66 2.162 -- Generating done
#66 2.166 -- Build files have been written to: /tmp/pdf2htmlEX-0.18.7-poppler-0.81.0/build
#66 2.316 Scanning dependencies of target pdf2htmlEX
#66 2.331 [  2%] Building CXX object CMakeFiles/pdf2htmlEX.dir/3rdparty/poppler/git/CairoFontEngine.cc.o
#66 2.669 In file included from /tmp/pdf2htmlEX-0.18.7-poppler-0.81.0/3rdparty/poppler/git/CairoFontEngine.cc:43:0:
#66 2.669 /tmp/pdf2htmlEX-0.18.7-poppler-0.81.0/3rdparty/poppler/git/CairoOutputDev.h:144:8: error: 'void CairoOutputDev::setDefaultCTM(const double*)' marked 'override', but does not override
#66 2.669    void setDefaultCTM(const double *ctm) override;
#66 2.669  

请告知我该如何解决这个问题。

4

0 回答 0