Public Repository

Last pushed: 15 days ago
Short Description
Full Description

NOTE:
This image is intended to be used with nfqlt/docker vagrant box and other nfqlt docker images.
Other use scenarios might work but are not tested yet.

Wkhtmltopdf toolbox

Info

This is an image of wkhtmltopdf Debian source in toolbox format, with included xvfb framebuffer

Configuration

Available binary paths for export:

  • /usr/bin/xvfb-run
  • /usr/bin/wkhtmltopdf

Sample configuration

wkhtmltopdf:
  image: nfqlt/wkhtmltopdf
  volumes_from:
    - './src:/home/project/src'
    - /tmp

dev:
  image: nfqlt/php56-dev
  volumes_from:
    - wkhtmltopdf
  volumes:
    - ./src:/home/project/src
    - /home/project/.ssh:/home/project/.ssh
    - /etc/ssh:/etc/ssh
    - /etc/gitconfig:/etc/gitconfig
    - /etc/environment:/etc/environment-vm:ro
  environment:
    NFQ_REMOTE_TOOL_WKHTMLTOPDF: >
      /usr/bin/xvfb-run
      /usr/bin/wkhtmltopdf

linker:
  image: nfqlt/linker17
  volumes:
    - /run/docker.sock:/run/docker.sock

Usage

wkhtmltopdf will not on its own, it needs an accessible frame buffer. For this requirement this has xvfb-run virtual frame buffer built-in

To run wkhtmltopdf with vfb just prepend xvfb-run command:

xvfb-run wkhtmltopdf http://www.google.com test.pdf

You can also pass additional parameters to X server itself like screen size, rezolution etc.:

xvfb-run -a -s "-screen 0 640x480x16" wkhtmltopdf http://www.google.com test.pdf

Limitations

As this image works on "toolbox" approach keep in mind that only /tmp and /home/project/src (from containers perspective) paths are accessible to wkhtmltopdf


Docker Pull Command
Owner
nfqlt

Comments (0)