docker-mdbook
docker-mdbook copied to clipboard
Compose fails if book uses Mermaid
Using the suggested compose.yml with a book that uses mdbook-mermaid, docker compose up fails with the following error:
[+] Running 1/0
✔ Container mdbook Created 0.0s
Attaching to mdbook
mdbook | 2024-06-14 10:31:06 [INFO] (mdbook::book): Book building has started
mdbook | 2024-06-14 10:31:06 [INFO] (mdbook::book): Running the html backend
mdbook | 2024-06-14 10:31:06 [ERROR] (mdbook::utils): Error: Rendering failed
mdbook | 2024-06-14 10:31:06 [ERROR] (mdbook::utils): Caused By: Unable to copy across additional CSS and JS
mdbook | 2024-06-14 10:31:06 [ERROR] (mdbook::utils): Caused By: Unable to copy /book/mermaid.min.js to /book/book/mermaid.min.js
mdbook | 2024-06-14 10:31:06 [ERROR] (mdbook::utils): Caused By: No such file or directory (os error 2)
mdbook exited with code 101
I have updated the instructions. We need the mermaid.min.js at the same level as book.toml.
Please refer to the example project.
cd ./example
# Run "mdbook serve"
docker compose up
# Run "mdbook build"
docker compose run --rm mdbook build
We can also consider the following.
- https://github.com/peaceiris/docker-mdbook/issues/130
We can also consider the following.
I think this would be the best approach.