auser/mdbook-builder

By auser

Updated over 1 year ago

Build mdbooks with pdf building

Image
Languages & frameworks
0

645

auser/mdbook-builder repository overview

mdbook-builder Docker Image

A multi-architecture Docker image for building and serving mdBook documentation with PDF export capability.

Features

  • ✅ Multi-architecture support (AMD64/ARM64)
  • ✅ PDF generation via mdbook-pdf
  • ✅ Chromium headless browser for PDF rendering
  • ✅ Small footprint with Alpine Linux base
  • ✅ Security-focused with non-root user

Quick Start

Pull the image from Docker Hub
docker pull auser/mdbook-builder:latest
Building a book

Mount your book directory to /book and run:

docker run --rm -v ${PWD}:/book auser/mdbook-builder build
Development server

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

Using with Docker Compose

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

Using with Just

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

Building the Image

Single Architecture
just build-image
Multi-Architecture (AMD64 and ARM64)
just build-push-multiarch

Environment Variables

VariableDescriptionDefault
CHROME_BINPath to Chromium binary/usr/bin/chromium-browser
CHROME_PATHPath to Chromium libraries/usr/lib/chromium/
CHROMIUM_FLAGSFlags for headless Chromium--headless --disable-gpu --no-sandbox --disable-dev-shm-usage

License

This project is open source and available under the MIT license.

Tag summary

Content type

Image

Digest

sha256:010068cdb

Size

299.5 MB

Last updated

over 1 year ago

docker pull auser/mdbook-builder:20250321