Dockerfile including mdBook and tools for writing Japanese technical documentation.
This container contains the following tools:
- mdBook
- mdbook-mermaid
- mdbook-linkcheck
- markdownlint-cli
- textlint
- cargo (for
mdbook test
)
The following pre-built images are available:
ghcr.io/gifnksm/mdbook-ja
(GitHub Container Registry)registry.gitlab.com/gifnksm/docker-mdbook-ja
(GitLab Container Registry)
Running with Docker:
# running mdBook
$ docker run \
-it --rm --init --user $(id -u):$(id -g) -v $(pwd):/book:rw --net host \
ghcr.io/gifnksm/mdbook-ja \
mdbook serve
# running markdown lint
$ docker run \
-it --rm --init --user $(id -u):$(id -g) -v $(pwd):/book:rw --net host \
ghcr.io/gifnksm/mdbook-ja \
markdownlint .
You can also use Compose:
# docker-compose.ymlversion: '3.9'
x-service:
&default-service
image: ghcr.io/gifnksm/mdbook-ja
init: true
volumes: [".:/book:rw"]
network_mode: "host"
user: "${UID}:${GID}"
services:
mdbook:
<<: *default-service
entrypoint: ["mdbook"]
command: ["serve"]
mdbook-mermaid:
<<: *default-service
entrypoint: ["mdbook-mermaid"]
markdownlint:
<<: *default-service
entrypoint: ["markdownlint"]
textlint:
<<: *default-service
entrypoint: ["textlint"]
# setting up environment variables
$ echo "UID=$(id -u)" >> .env
$ echo "GID=$(id -u)" >> .env
# serving mdBook website
$ docker compose up
# running mdBook build
$ docker compose run --rm mdbook build
# running markdown lint
$ docker compose run --rm markdownlint .
This repository is hosted at: