Docker container for building books in multiple formats (PDF, EPUB, MOBI, HTML).
This container provides all necessary tools to convert Markdown files into various book formats, handling formatting, image inclusion, and proper metadata. It encapsulates the complexity of the book-building process, including all required dependencies.
- Generate PDFs with proper formatting and typography
- Create EPUBs with reliable image inclusion
- Convert EPUBs to MOBI format for Kindle
- Build standalone HTML versions
- All necessary tools pre-installed and configured
docker run -v $(pwd):/workspace iksnae/book-builder ./build.shdocker run -v $(pwd):/workspace iksnae/book-builder ./build.sh --format pdfdocker run -v $(pwd):/workspace iksnae/book-builder ./build.sh \
--config my-config.yml \
--output ./my-books \
--lang esThe container includes several specialized tools:
This utility ensures images are properly included in EPUB files:
generate-epub --title "My Book" --cover cover.png input.md output.epubOptions:
--title- Book title--author- Book author/creator--publisher- Book publisher--cover- Path to cover image--language- Book language code (e.g., en, es)--resource-path- Resource search paths (colon-separated)--toc-depth- Table of contents depth--verbose- Show detailed processing information
When using this container, organize your book project with this recommended structure:
.
├── book/
│ ├── en/ # English content
│ │ ├── chapter-01/ # Chapters
│ │ │ ├── 00-introduction.md
│ │ │ └── 01-content.md
│ │ └── images/ # English-specific images
│ ├── es/ # Spanish content
│ │ └── ...
│ └── images/ # Shared images
├── art/
│ └── cover.png # Cover image
├── config/
│ └── book-config.yml # Configuration
└── build.sh # Build script
If you encounter issues:
- Use the
--verboseflag with utilities for detailed output - Check image paths and ensure they're accessible
- Verify your Markdown syntax is correct
- Run the container with the
-itflag to interactively debug
To build this Docker image locally:
git clone https://github.com/iksnae/book-builder.git
cd book-builder
docker build -t iksnae/book-builder:latest .See LICENSE file.