user5005768Himadree
user5005768Himadree

Reputation: 1439

How to fix wkhtmltopdf Warning: Failed to load image from Docker container?

I'm trying to run wkhtmltopdf inside a Docker container, but it fails to load images from external URLs. The command I'm using is:

wkhtmltopdf document.html output.pdf

Warning: Failed to load http://example.com/image.png (ignore)

While the HTML document converts fine, it doesn't load images from URLs like http://example.com/image.png. I can access the image URLs in the browser, and the container has internet access, but wkhtmltopdf still can't load the images.

$ curl -I http://example.com/image.png.
curl: (6) Could not resolve host: example.com

How can I fix this so that wkhtmltopdf correctly loads external images from inside the Docker container?

Upvotes: 0

Views: 33

Answers (0)

Related Questions