/docker-mdbook-ja

Dockerfile including mdBook and tools for writing Japanese technical documentation.

Primary LanguageDockerfileCreative Commons Zero v1.0 UniversalCC0-1.0

docker-mdbook-ja

Dockerfile including mdBook and tools for writing Japanese technical documentation.

This container contains the following tools:

Container Image

The following pre-built images are available:

Usage

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 .

Source Repository

This repository is hosted at: