|
# Container image that runs your code. |
|
# |
|
# multimarkdown is built from source in a first stage rather than pulled from |
|
# an unmaintained third-party image, so the dependency is auditable. The base |
|
# images are pinned by digest; refresh them deliberately, not implicitly. |
|
# |
|
# TODO: replace the tag below with the digest for the platform you publish |
|
# from -- `docker buildx imagetools inspect debian:bookworm-slim` -- so the |
|
# build stops floating. Left as a tag here because the digest must be |
|
# chosen by whoever owns the registry, not guessed. |
|
FROM debian:bookworm-slim AS multimarkdown-build |
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \ |
|
build-essential cmake git ca-certificates \ |
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
# Pinned to a tagged release rather than a moving branch. |
|
ARG MMD_VERSION=6.6.0 |
|
RUN git clone --depth 1 --branch "$MMD_VERSION" \ |
|
https://github.com/fletcher/MultiMarkdown-6.git /src/mmd \ |
|
&& cd /src/mmd \ |
|
&& cmake -B build -DCMAKE_BUILD_TYPE=Release \ |
|
&& cmake --build build --target multimarkdown -j "$(nproc)" |
|
|
|
FROM debian:bookworm-slim |
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \ |
|
bash gawk sed grep coreutils make \ |
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
COPY --from=multimarkdown-build /src/mmd/build/multimarkdown /usr/local/bin/multimarkdown |
|
|
|
COPY ./ /tmp/jenny |
|
RUN (cd /tmp/jenny && make install) && rm -rf /tmp/jenny |
|
|
|
WORKDIR /blog |
|
ENTRYPOINT ["jenny"] |