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
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.
Did you use the from ? use
FROM ruby:2.5.1-alpine
RUN apk --update add ttf-ubuntu-font-family wkhtmltopdf
Installing wkhtmltopdf
from the alpine repo doesn't work in some cases due to a missing qt patches. Some images (eg 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/
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.