0

I have installed wkhtmltopdf(patched qt)0.12.4 which gives error using with pdfkit. I want to install unpatched qt version as does't give me error in my localsetup

my dockerfile :

FROM python:3
RUN apt-get update
RUN apt-get install -y openssl build-essential libssl-dev libxrender-dev git-core libx11-dev libxext-dev libfontconfig1-dev libfreetype6-dev fontconfig libfontconfig1 libxrender1
RUN curl -L#o wk.tar.xz https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz \
&& tar xf wk.tar.xz \
&& cp wkhtmltox/bin/wkhtmltopdf /usr/bin \
&& cp wkhtmltox/bin/wkhtmltoimage /usr/bin \
&& rm wk.tar.xz \
&& rm -r wkhtmltox
WORKDIR /app/
COPY . /app
COPY requirements.txt /app

RUN pip install -r requirements.txt


EXPOSE 5000

MY docker compose File:

version: "3.7"

volumes:
   db_data:

services:
   db:
    image: mysql:5.7.29
    command: --default-authentication-plugin=mysql_native_password
    restart: always
    environment:
       MYSQL_ROOT_PASSWORD: root
       MYSQL_USER: root
       MYSQL_PASSWORD: root
       MYSQL_DATABASE: mycamdata
    volumes:
       - db_data:/var/lib/mysql
    ports:
       - "3306:3306"

   adminer:
      image: adminer
      restart: always
      ports:
        - 8080:8080

   app:
      build: .
      command: python run.py --host=0.0.0.0 --port=5000
      volumes:
         - .:/app
      ports:
         - 5000:5000
      depends_on:
         - db

While trying to create pdf I am getting this error: i think this error is because of wkhtmltopdf(patched qt) version is not compitable with pdfkit. i want to install unpatched qt version

OSError: wkhtmltopdf reported an error: Loading pages (1/6) [> ] 0% [======> ] 10% QSslSocket: cannot resolve CRYPTO_num_locks QSslSocket: cannot resolve CRYPTO_set_id_callback QSslSocket: cannot resolve CRYPTO_set_locking_callback QSslSocket: cannot resolve sk_free QSslSocket: cannot resolve sk_num QSslSocket: cannot resolve sk_pop_free QSslSocket: cannot resolve sk_value QSslSocket: cannot resolve SSL_library_init QSslSocket: cannot resolve SSL_load_error_strings QSslSocket: cannot resolve SSLv3_client_method QSslSocket: cannot resolve SSLv23_client_method QSslSocket: cannot resolve SSLv3_server_method QSslSocket: cannot resolve SSLv23_server_method QSslSocket: cannot resolve X509_STORE_CTX_get_chain QSslSocket: cannot resolve OPENSSL_add_all_algorithms_noconf QSslSocket: cannot resolve OPENSSL_add_all_algorithms_conf QSslSocket: cannot resolve SSLeay QSslSocket: cannot call unresolved function CRYPTO_num_locks QSslSocket: cannot call unresolved function CRYPTO_set_id_callback QSslSocket: cannot call unresolved function CRYPTO_set_locking_callback QSslSocket: cannot call unresolved function SSL_library_init QSslSocket: cannot call unresolved function SSLv23_client_method QSslSocket: cannot call unresolved function sk_num [======================> ] 38% [===========================> ] 45% QSslSocket: cannot call unresolved function SSLv23_client_method QSslSocket: cannot call unresolved function SSL_library_init QSslSocket: cannot call unresolved function SSLv23_client_method QSslSocket: cannot call unresolved function SSL_library_init QSslSocket: cannot call unresolved function SSLv23_client_method QSslSocket: cannot call unresolved function SSL_library_init QSslSocket: cannot call unresolved function SSLv23_client_method QSslSocket: cannot call unresolved function SSL_library_init [============================================================] 100% Counting pages (2/6)
[============================================================] Object 1 of 1 Resolving links (4/6)
[============================================================] Object 1 of 1 Loading headers and footers (5/6)
Printing pages (6/6) [> ] Preparing [============================================================] Page 1 of 1 Done
Exit with code 1 due to network error: UnknownNetworkError QSslSocket: cannot call unresolved function CRYPTO_num_locks QSslSocket: cannot call unresolved function CRYPTO_set_id_callback QSslSocket: cannot call unresolved function CRYPTO_set_locking_callback


Bhaumik
  • 11
  • 1
  • 5
  • 1
    That Dockerfile doesn't have a `CMD`; how do you run it? It seems like you're missing a couple of runtime C shared libraries too, what have you tried to install those? – David Maze Apr 13 '20 at 14:04
  • I am using docker compose file , to run docker file. – Bhaumik Apr 14 '20 at 04:55

1 Answers1

0

I solved by adding the next lines to my Debian Buster image based dockerfile (wkhtmlto* version 0.12.6-1, June 2021)

RUN apt-get update -qq && apt-get install -y \
    # packages required by wkhtmlto*:
    xfonts-base \
    xfonts-75dpi \
    pdftk # -> only if needed... \
    # ...other custom packages...

RUN curl -L#o wkhtmltopdf.deb https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.buster_amd64.deb
RUN dpkg -i wkhtmltopdf.deb; apt-get install -y -f

# Remember to clean your package manager cache to reduce your custom image size...
RUN apt-get clean all \
    && rm -rvf /var/lib/apt/lists/*

You can find other builds of the same package here: https://github.com/wkhtmltopdf/packaging/releases/0.12.6-1