RUN apk --update add ttf-ubuntu-font-family wkhtmltopdf
I am trying to install wkhtml using this command on docker image ruby-2.5.1:alpine but error is:
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
ERROR: unsatisfiable constraints:
wkhtmltopdf (missing):
required by: world[wkhtmltopdf]
The command '/bin/sh -c apk --update add ttf-ubuntu-font-family wkhtmltopdf' returned a non-zero code: 1
is there any way to install it? thanks in advance
Update your base image, seem like it pulling from v3.7, as you can see the error
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
Where v3.7 does not contain wkhtmltopdf
v3.7 wkhtmltopdf not exist
or if you do not want update the image then you can install it from v3.10 wkhtmltopdf
RUN apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.10/main/ wkhtmltopdf=0.12.5-r0
Btw this base image will work without modification.
2.5-alpine3.9
Installing wkhtmltopdf from the alpine repo doesn't work in some cases due to a missing qt patches. Some images (e.g. https://github.com/madnight/docker-alpine-wkhtmltopdf) have the patches applied and it's possible to use the patched binary as:
FROM madnight/docker-alpine-wkhtmltopdf as wkhtmltopdf_image
FROM ruby-alpine
COPY --from=wkhtmltopdf_image /bin/wkhtmltopdf /bin/
See also: https://github.com/mileszs/wicked_pdf/issues/841
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With