Dockerized html-pdf-chrome, with headless chromium running in the background 🐳
1.6K
Dockerized html-pdf-chrome, with headless chromium running in the background.
| Tag | Dockerfile Build Context |
|---|---|
:0.8.4, :latest | View |
alpine, and include node and npmTo 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.4
For 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.js
For 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.4
See 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.ps1
To 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 -AutoRelease
To perform a dry run, use -WhatIf.
Content type
Image
Digest
sha256:726f7c677…
Size
282.2 MB
Last updated
over 2 years ago
docker pull theohbrothers/docker-html-pdf-chrome