Build mdbooks with pdf building
645
A multi-architecture Docker image for building and serving mdBook documentation with PDF export capability.
docker pull auser/mdbook-builder:latest
Mount your book directory to /book and run:
docker run --rm -v ${PWD}:/book auser/mdbook-builder build
To serve your book with live reloading:
docker run --rm -p 8989:8989 -v ${PWD}:/book auser/mdbook-builder serve --hostname 0.0.0.0
Then access your book at http://localhost:8989
Create a docker-compose.yml file:
services:
mdbook:
image: auser/mdbook-builder:latest
ports:
- 8989:8989
volumes:
- ${PWD}:/book
command:
- serve
- --hostname
- '0.0.0.0'
- --port
- '8989'
Then run:
docker compose up
This repository includes a Justfile with common commands for development and building:
# Setup
just setup
# Development server
just dev
# Build the book (HTML and PDF)
just build
# Check for errors
just check
just build-image
just build-push-multiarch
| Variable | Description | Default |
|---|---|---|
| CHROME_BIN | Path to Chromium binary | /usr/bin/chromium-browser |
| CHROME_PATH | Path to Chromium libraries | /usr/lib/chromium/ |
| CHROMIUM_FLAGS | Flags for headless Chromium | --headless --disable-gpu --no-sandbox --disable-dev-shm-usage |
This project is open source and available under the MIT license.
Content type
Image
Digest
sha256:010068cdb…
Size
299.5 MB
Last updated
over 1 year ago
docker pull auser/mdbook-builder:20250321