Skip to content

Commit

Permalink
Import Containerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
gbraad committed Dec 3, 2024
1 parent 5150be7 commit 54a3893
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
18 changes: 18 additions & 0 deletions containers/Containerfile
Original file line number Diff line number Diff line change
@@ -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
32 changes: 32 additions & 0 deletions containers/README.md
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 54a3893

Please sign in to comment.