Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Progress stuck on 10% when running on Mac #24

Closed
alchermd opened this issue Oct 28, 2021 · 3 comments
Closed

Progress stuck on 10% when running on Mac #24

alchermd opened this issue Oct 28, 2021 · 3 comments

Comments

@alchermd
Copy link

alchermd commented Oct 28, 2021

My specs:

image

Minimal steps to reproduce:

$ docker run -it surnet/alpine-python-wkhtmltopdf:3.8.5-0.12.6-small-alpine12 sh
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
/ # wkhtmltopdf google.com google.pdf
Loading pages (1/6)
[======>                                                     ] 10%

I just tried the same on a Linux laptop (Linux Mint 20.1 Cinnamon), as well as in this Mac (in the host, not the container) and was able to execute without any hiccups:

$ wkhtmltopdf --version
wkhtmltopdf 0.12.6 (with patched qt)
$ wkhtmltopdf google.com google.pdf
Loading pages (1/6)
Counting pages (2/6)
Resolving links (4/6)
Loading headers and footers (5/6)
Printing pages (6/6)
Done

Upon further debugging, executing the non-python version of this image seems to work just fine:

$ docker run -it --entrypoint sh surnet/alpine-wkhtmltopdf:3.13.5-0.12.6-small
/ # wkhtmltopdf google.com test.pdf
Loading pages (1/6)
Counting pages (2/6)
Resolving links (4/6)
Loading headers and footers (5/6)
Printing pages (6/6)
Done

For completion's sake here's my project's Docker related information:

My Dockerfile:

FROM surnet/alpine-python-wkhtmltopdf:3.8.5-0.12.6-small-alpine12

# set work directory
WORKDIR /usr/src/web

# set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

# install psycopg2 dependencies
RUN apk update \
  && apk add postgresql-dev gcc python3-dev musl-dev \
# install Pillow dependencies
     gcc jpeg-dev zlib-dev

# install dependencies
RUN pip install --upgrade pip
COPY ./requirements.txt .
RUN pip install -r requirements.txt

# copy project
COPY . .

# run entrypoint.sh
ENTRYPOINT ["/usr/src/web/entrypoint.sh"]

My docker-compose.yml file

version: '3.7'

services:
  web:
    build: ./web
    command: python manage.py runserver 0.0.0.0:80
    volumes:
      - ./web/:/usr/src/web/
      - media_volume:/usr/src/web/media
    ports:
      - 8000:80
    env_file:
      - ./env/.env.dev
  db:
    image: postgres:12.0-alpine
    volumes:
      - postgres_data:/var/lib/postgresql/data/
    environment:
      - POSTGRES_DB=<snip>
      - POSTGRES_USER=<snip>
      - POSTGRES_PASSWORD=<snip>
volumes:
  postgres_data:
  media_volume:

Steps to replicate on my project:

$ docker-compose up -d --build
$ docker-compose exec web sh
/usr/src/ # ./wkhtmltopdf google.com test.pdf
Loading pages (1/6)
[======>                                                     ] 10%

Please let me know if I need to provide more information. Thank you for this project!

@chdanielmueller
Copy link
Member

Please try with version 3.9.5-0.12.6-small
On this page you can see all the versions which support the arm64 architecture which at the moment is just this specific version: https://hub.docker.com/r/surnet/alpine-python-wkhtmltopdf/tags

@alchermd
Copy link
Author

Thank you @chdanielmueller , this works!

@chdanielmueller
Copy link
Member

Great! Thanks for the feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants