Sign inSign up

ivaquero/mkdocs

By ivaquero

Updated over 8 years ago

MkDocs container image

Image
0

1.2K

ivaquero/mkdocs repository overview

MkDocs

This is an MkDocs container image, that runs an MkDocs server at port 8000 by default.

In order to launch the container, you must mount your MkDocs documents at /project, like this:

docker run -d -v $(pwd)/data:/project -p 8000:8000 ivaquero/mkdocs:0.17.2

You can also specify some environment variables in order to control some aspects of the container behaviour:

  • MKDOCS_IP: Restricts the IP on which the server listens for requests. By default it's 0.0.0.0
  • MKDOCS_PORT: The port where the server listens at. By default it's 8000
  • MKDOCS_DEBUG: Whether we want verbose output or not. By default it's false.

### Dockerfile

Here we reproduce the Dockerfile used to create the container:

FROM python:2.7.14-alpine3.6

LABEL org.opencontainers.image.authors="Ignacio Vaquero <[email protected]>" \
      org.opencontainers.image.version="0.17.2" \
      org.opencontainers.image.title="MkDocs" \
      org.opencontainers.image.description="MkDocs docker image"

EXPOSE 8000

RUN apk add --no-cache tini=0.14.0-r0 && \
    pip install mkdocs==0.17.2 && \
    mkdir -p /project

VOLUME /project

WORKDIR /project

COPY docker-entrypoint.sh /docker-entrypoint.sh

ENV MKDOCS_DEBUG="false" \
    MKDOCS_IP="0.0.0.0" \
    MKDOCS_PORT="8000"

ENTRYPOINT ["/sbin/tini", "--"]

CMD ["/docker-entrypoint.sh"]
docker-entrypoint.sh

Here we reproduce the launch script for the container:

#!/bin/sh
set -e

if [ "${MKDOCS_DEBUG}" = "true" ]; then
  mkdocs serve -v -a ${MKDOCS_IP}:${MKDOCS_PORT}
else
  mkdocs serve -a ${MKDOCS_IP}:${MKDOCS_PORT}
fi

Tag summary

Content type

Image

Digest

Size

31.4 MB

Last updated

over 8 years ago

docker pull ivaquero/mkdocs