From 54a389307ad237e097775419402107e28e25b200 Mon Sep 17 00:00:00 2001 From: Gerard Braad Date: Tue, 3 Dec 2024 06:24:16 +0000 Subject: [PATCH] Import Containerfile from https://github.com/gbraad-redhat/mdbook --- containers/Containerfile | 18 ++++++++++++++++++ containers/README.md | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 containers/Containerfile create mode 100644 containers/README.md diff --git a/containers/Containerfile b/containers/Containerfile new file mode 100644 index 0000000..51306cb --- /dev/null +++ b/containers/Containerfile @@ -0,0 +1,18 @@ +FROM registry.fedoraproject.org/fedora:40 AS builder + + +RUN dnf install -y cargo \ + && cargo install mdbook \ + && cargo install mdbook-callouts \ + && cargo install mdbook-mermaid + + +FROM registry.fedoraproject.org/fedora:40 + +COPY --from=builder /root/.cargo/bin/mdbook /usr/bin +COPY --from=builder /root/.cargo/bin/mdbook-callouts /usr/bin +COPY --from=builder /root/.cargo/bin/mdbook-mermaid /usr/bin + +RUN mkdir -p /workspace +VOLUME /workspace +WORKDIR /workspace diff --git a/containers/README.md b/containers/README.md new file mode 100644 index 0000000..964ed74 --- /dev/null +++ b/containers/README.md @@ -0,0 +1,32 @@ +Fedora image for mdBook-based generation +======================================== + + +This Fedora container image contains: + + - mdBook: https://github.com/rust-lang/mdBook + create book from markdown files, like Gitbook + - mdBook preprocessor: https://crates.io/crates/mdbook-callouts + to add Obsidian Flavored Markdown's Callouts + + +## Usage instructions +Start the container in the folder that contains your documentation source + +```bash +$ podman run --rm -v $PWD:/workspace \ + ghcr.io/gbraad-redhat/mdbook:0.4.42 \ + mdbook build +``` + +This will generate a `book` output. + +Or using + +```bash +$ podman run --rm -v $PWD:/workspace -p 3000:3000 \ + ghcr.io/gbraad-redhat/mdbook:0.4.42 \ + mdbook serve +``` + +the generated content will be published using the embedded server on [`http://localhost:3000`](http://localhost:3000)