Notes on creating a Docker image for asciidoctor-web-pdf.
asciidoctor-web-pdf does not provide a Docker image. However, it does provide binaries. Strategy: start from asciidoctor/docker-asciidoctor:1.11 and layer in the asciidoctor-web-pdf v1.0.0-alpha.12 binary.
However, this binary is not compatible with Alpine Linux.
Ok so tell pkg to create an Alpine image:
diff --git a/tasks/prepare-binaries.js b/tasks/prepare-binaries.js
index cb011d9..aaf22bb 100644
--- a/tasks/prepare-binaries.js
+++ b/tasks/prepare-binaries.js
@@ -13,6 +13,7 @@ const buildDirPath = path.join(__dirname, '..', buildDir)
// Can specify linux/mac/win as first argument to only build one of these platforms
const platforms = {
+ alpine: {target: 'node12-alpine-x64', puppeteerPlatform: 'linux' },
linux: { target: 'node12-linux-x64' },
mac: { target: 'node12-macos-x64' },
win: { target: 'node12-win-x64', suffix: '.exe', puppeteerPlatform: 'win64' }
This fixes the pkg generated binary however the chromium binary is not compatible with Alpine Linux and no chromium snapshots are provided for Alpine.
Alpine provides chromium. However, puppeteer and chromium versions are tightly coupled. A specific version of puppeteer requires a specific version of chromium.
Use the version of chromium provided by Alpine then explicitly use the version of puppeteer compatible with it.