Sign inSign up

sbitio/wkhtmltox

By sbitio

•Updated almost 6 years ago

Image
0

3.3K

sbitio/wkhtmltox repository overview

⁠docker-wkhtmltox

DockerHub Badge

This docker container lets you run wkhtmltopdf in a docker container.

⁠Building the image

docker build .

⁠Using the image

docker run -v $(pwd):/tmp sbitio/wkhtmltox https://sbit.io /tmp/output.pdf
# For wkhtmltoimage:
docker run -v $(pwd):/tmp --entrypoint wkhtmltoimage sbitio/wkhtmltox https://sbit.io /tmp/output.png

The mounted volume can be used to send local html files and to save the output.

⁠Using as a service

We leverage gogap/go-wkhtmltox⁠ to provide an as-a-service container on tag aas-latest:

docker run -d --rm --name wkhtmltox sbitio/wkhtmltox:aas-latest
curl -s -X POST \
  "http://$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' wkhtmltox):8080/v1/convert" \
  -H 'accept-encoding: gzip' \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json' \
  -d '{
    "to" : "image",
    "converter":{
      "uri": "https://sbit.io"
    },
	  "template": "binary"
  }' --compressed -o sbit.jpg
docker stop wkhtmltox

⁠Authors and Contributors

This image was built at sbit.io⁠.

Tag summary

Content type

Image

Digest

Size

122 MB

Last updated

almost 6 years ago

docker pull sbitio/wkhtmltox