Sign inSign up

ajg555/mkdocs

By ajg555

Updated about 1 month ago

A Docker image for MkDocs to build code documentation

Image
Developer tools
0

150

ajg555/mkdocs repository overview

MkDocs Docker Image

A Docker image for MkDocs, using an official Python image based on Alpine Linux.

The image allows you to create, build, and serve MkDocs documentation projects without requiring a local Python or MkDocs installation.

Repository

The Dockerfiles used to build this image are available at:

https://github.com/ajg555/mkdocs-dockerfiles

MkDocs

Official MkDocs repository:

https://github.com/mkdocs/mkdocs

Official MkDocs documentation:

https://www.mkdocs.org/user-guide/installation/

Quick Start

Create a new project

Create a new MkDocs project in the current directory:

docker run --rm \
  --name mkdocs \
  -v "$PWD:/docs" \
  mkdocs new my-wiki

Then enter the newly created project:

cd my-wiki

Build the documentation

Build the documentation project:

docker run --rm \
  --name mkdocs \
  -v "$PWD:/docs" \
  mkdocs build

The generated website will be available in the site/ directory.

Serve a project

Start the MkDocs development server:

docker run --rm \
  --name mkdocs \
  -p 8000:8000 \
  -v "$PWD:/docs" \
  mkdocs

The default command is equivalent to:

mkdocs serve --dev-addr=0.0.0.0:8000

The documentation will be available at:

http://localhost:8000

Usage Examples

Show help

docker run --rm \
  --name mkdocs \
  -v "$PWD:/docs" \
  mkdocs --help

Show version

docker run --rm \
  --name mkdocs \
  -v "$PWD:/docs" \
  mkdocs --version

Create a shell alias

To simplify usage, you can create an alias for the Dockerized MkDocs command.

Add the following to your ~/.bashrc:

alias mkdocs="docker run \
  --rm \
  --name mkdocs \
  -p 8000:8000 \
  -v \"\$PWD:/docs\" \
  mkdocs"

After adding the alias, reload your shell:

source ~/.bashrc

You can then use MkDocs normally:

mkdocs new my-wiki
mkdocs build
mkdocs serve

The commands are executed inside the Docker container without requiring a local MkDocs installation.

Tag summary

Content type

Image

Digest

sha256:e25f088c6

Size

36.9 MB

Last updated

about 1 month ago

docker pull ajg555/mkdocs