Sign inSign up

ruseler/doxygen

By ruseler

•Updated 5 months ago

Multi-stage Alpine build to provide Doxygen with git and Graphviz.

Image
Languages & frameworks
Developer tools
Web servers
0

149

ruseler/doxygen repository overview

⁠Doxygen + Graphviz (Alpine)

A lightweight, high-performance Docker image for generating Doxygen⁠ documentation. This image uses a multi-stage Alpine build to provide a minimal runtime environment including Graphviz for generating call graphs and inheritance diagrams.

# =========================
# Builder stage
# =========================
FROM alpine:latest AS builder

ARG DOXYGEN_REF=master

RUN apk add --no-cache \
    build-base \
    cmake \
    python3 \
    flex \
    bison \
    git

WORKDIR /src

# Clone official repository
RUN git clone --depth 1 \
    --branch ${DOXYGEN_REF} \
    https://github.com/doxygen/doxygen.git .

# Configure + build + install
RUN cmake -S . -B build \
    -G "Unix Makefiles" \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/opt/doxygen \
    && cmake --build build -j"$(nproc)" \
    && cmake --install build


# =========================
# Runtime stage
# =========================
FROM alpine:latest

RUN apk add --no-cache \
    git \
    graphviz \
    libstdc++

COPY --from=builder /opt/doxygen /opt/doxygen

ENV PATH="/opt/doxygen/bin:${PATH}"

WORKDIR /workspace

# This allows the container to run doxygen by default, 
# but makes it much easier to override with a shell script.
CMD ["doxygen"]

⁠🚀 Quick Start

Run this command in your project root to generate documentation using your existing Doxyfile:

docker run --rm -v $(pwd):/workspace <your-username>/doxygen

⁠🛠 Features

  • Ultra-Lightweight: Built on Alpine Linux (~100MB).
  • Graphviz Integration: Full support for HAVE_DOT = YES to generate SVG/PNG diagrams.
  • Clang-Assisted Parsing: Optimized for C/C++ projects.
  • CI/CD Ready: Perfect for GitHub Actions, GitLab CI, and local development.

⁠📖 Usage Examples

⁠Using a custom Doxyfile

If your configuration file is named differently (e.g., Doxyfile.ci):

docker run --rm -v $(pwd):/workspace <your-username>/doxygen Doxyfile.ci

⁠Integrated with Docker Compose

Add this to your docker-compose.yml for a standardized local build environment:

services:
  docs:
    image: <your-username>/doxygen
    volumes:
      - .:/workspace
    # Overriding the entrypoint for complex scripts
    entrypoint: /bin/sh
    command: -c "doxygen Doxyfile && echo 'Docs built!'"

⁠📂 Volume Mapping

The image uses /workspace as the default working directory. Ensure you map your project root to this path:

  • Source code: Should be accessible relative to the Doxyfile.
  • Output: Ensure your OUTPUT_DIRECTORY in the Doxyfile points to a path within the mapped volume (e.g., ./docs) to persist the files on your host.

⁠🛠 Build it yourself

docker build -t <your-username>/doxygen .


⁠💡 Pro-Tip for Docker Hub

When you go to your repository on Docker Hub:

  1. Short Description: "Minimal Doxygen + Graphviz image based on Alpine for fast API documentation."
  2. README: Paste the Markdown above into the "Full Description" section.
  3. Tags: Use latest for your main build, but consider tagging versions (e.g., 1.10.0-alpine) so users can have reproducible builds.

Tag summary

Content type

Image

Digest

sha256:9ecf2f1db…

Size

32.6 MB

Last updated

5 months ago

docker pull ruseler/doxygen:alpine