Dockerized html-pdf-chrome, with headless chromium running in the background.
| Tag | Dockerfile Build Context |
|---|---|
:0.8.4, :latest |
View |
- All images are based on
alpine, and includenodeandnpm
To export a remote HTML page as .pdf:
docker run --rm -it -e URL=http://localhost -e PDF_FILE=export.pdf -v $(pwd):$(pwd) -w $(pwd) --network host theohbrothers/docker-html-pdf-chrome:0.8.4
docker run --rm -it -e URL=https://example.com -e PDF_FILE=export.pdf -v $(pwd):$(pwd) -w $(pwd) theohbrothers/docker-html-pdf-chrome:0.8.4For export more complex cases, mount your custom script as /export.js:
docker run --rm -it -v $(pwd)/export.js:/export.js -v $(pwd):$(pwd) -w $(pwd) theohbrothers/docker-html-pdf-chrome:0.8.4 node /export.jsFor a sleeping container (to reduce overhead of restarting chromium every run):
docker run --rm -it -e SLEEP=1 -v $(pwd):$(pwd) -w $(pwd) theohbrothers/docker-html-pdf-chrome:0.8.4See html-pdf-chrome usage.
Requires Windows powershell or pwsh.
# Install Generate-DockerImageVariants module: https://github.com/theohbrothers/Generate-DockerImageVariants
Install-Module -Name Generate-DockerImageVariants -Repository PSGallery -Scope CurrentUser -Force -Verbose
# Edit ./generate templates
# Generate the variants
Generate-DockerImageVariants .versions.json contains a list of Semver versions, one per line.
To update versions in versions.json:
./Update-Versions.ps1To update versions in versions.json, and open a PR for each changed version, and merge successful PRs one after another (to prevent merge conflicts), and finally create a tagged release and close milestone:
$env:GITHUB_TOKEN = 'xxx'
./Update-Versions.ps1 -PR -AutoMergeQueue -AutoReleaseTo perform a dry run, use -WhatIf.