From ce1f0513331e2f06476775eda9f3963d6095565d Mon Sep 17 00:00:00 2001 From: barthel Date: Thu, 10 Oct 2024 11:45:44 +0200 Subject: [PATCH] Remove TikZ because it's available in original Asciidoctor Docker image since 1.78.0. --- Dockerfile | 24 ++++++++++++------------ README.md | 15 ++++++++++----- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/Dockerfile b/Dockerfile index 01583ac..704c449 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,5 @@ ARG ASCIIDOCTOR_BASE_TAG=${CIRCLE_TAG:-latest} +ARG ASCIIDOCTOR_BASE_IMAGE=${ASCIIDOCTOR_BASE_IMAGE:-"docker.io/asciidoctor/docker-asciidoctor"} ARG alpine_version=3.20 # ========================================= @@ -20,24 +21,26 @@ git \ # ========================================= -FROM asciidoctor/docker-asciidoctor:${ASCIIDOCTOR_BASE_TAG} AS asciidoctor-builder +FROM ${ASCIIDOCTOR_BASE_IMAGE}:${ASCIIDOCTOR_BASE_TAG} AS asciidoctor-builder +ARG ASCIIDOCTOR_BASE_TAG +ARG ASCIIDOCTOR_BASE_IMAGE ARG TARGETARCH ARG CONTAINER_INFORMATION +ARG _container_information="${CONTAINER_INFORMATION} - (${TARGETARCH}) based on ${ASCIIDOCTOR_BASE_IMAGE}:${ASCIIDOCTOR_BASE_TAG}" LABEL MAINTAINERS="barthel " LABEL maintainers="barthel " -LABEL CONTAINER_INFORMATION="${CONTAINER_INFORMATION}" +LABEL CONTAINER_INFORMATION="${_container_information}" + +ARG CONTAINER_INFO_FILE="/container_info" +ENV CONTAINER_INFO_FILE=${CONTAINER_INFO_FILE} # Set ENV variable to the value of the ARG parameter and add TARGETARCH # This ensures that the ARG value is used and not an ENV that may have been overwritten by the base container. -RUN export CONTAINER_INFORMATION="${CONTAINER_INFORMATION} - (${TARGETARCH})" && \ - echo $CONTAINER_INFORMATION > /tmp/container_info && \ - echo "CONTAINER_INFORMATION=${CONTAINER_INFORMATION}" > /tmp/envs +RUN echo ${_container_information} > ${CONTAINER_INFO_FILE} \ + && chmod ugo+rw ${CONTAINER_INFO_FILE} # Load the ENV variable from the temporary file to make it available in the container -ENV CONTAINER_INFORMATION="$(cat /tmp/container_info)" - -# Optional: Entferne die temporäre Datei, wenn nicht mehr benötigt -RUN rm /tmp/container_info /tmp/envs +ENV CONTAINER_INFORMATION="${_container_information}" # Print the architecture RUN echo "Building for architecture: ${TARGETARCH}" @@ -62,13 +65,10 @@ RUN cat /etc/alpine-release \ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Install imagemagick for meme - @see: https://asciidoctor.org/docs/asciidoctor-diagram/#meme # Install svgbob - @see: https://github.com/ivanceras/svgbob -# Install tikz (texlive, pdf2svg) - @see: https://github.com/pgf-tikz/pgf # install MS core font package (non free fonts) - @see: https://wiki.alpinelinux.org/wiki/Fonts#Non-free_fonts RUN apk --no-cache add \ imagemagick \ svgbob@testing \ - texlive texmf-dist-latex texmf-dist-latexextra texmf-dist-lang \ - pdf2svg@testing \ git \ msttcorefonts-installer \ && update-ms-fonts \ diff --git a/README.md b/README.md index 40dc0b0..bdb3e7d 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ The goal of this project is to build a multi-platform (arm64, amd64) Docker image based on the original [Asciidoctor Docker image](https://github.com/asciidoctor/docker-asciidoctor) and adding all extra diagram tools supported by [Asciidoctor Diagram](https://docs.asciidoctor.org/diagram-extension/latest/). -An overview of all supported diagram types, generated as HTML and as PDF, can be found here: https://barthel.github.io/docker-asciidoctor/ +An overview of all supported diagram types, generated as HTML and as PDF, can be found here: ## ⚠️ Note @@ -38,18 +38,19 @@ The following additional diagram tools are installed: * [svgbob](https://github.com/ivanceras/svgbob) * [symbolator](https://github.com/hdl/symbolator) uses fork, because of incompatible python setup (2to3) * [syntrax](https://kevinpt.github.io/syntrax) -* [tikz](https://github.com/pgf-tikz/pgf) +* [tikz](https://github.com/pgf-tikz/pgf)[1] * [umlet](https://www.umlet.com) * [vega](https://vega.github.io/vega) and [vega-lite](https://vega.github.io/vega-lite) * [wavedrom](https://wavedrom.com/) Additional non-diagram tools: + * [htmlark](https://github.com/BitLooter/htmlark) > Embed images, CSS, and JavaScript into an HTML file. Through the magic of data URIs, HTMLArk can save these external dependencies inline right in the HTML. \ - > —David Powell, https://github.com/BitLooter/htmlark -* [inliner](https://github.com/barthel/inliner) fork of https://github.com/remy/inliner + > —David Powell, +* [inliner](https://github.com/barthel/inliner) fork of > Turns your web page to a single HTML file with everything inlined - perfect for appcache manifests on mobile devices that you want to reduce those http requests. - > —Remy Sharp, https://github.com/remy/inliner + > —Remy Sharp, * [asciidoctor-extensions](https://github.com/asciidoctor/asciidoctor-extensions-lab) available in `/usr/local/asciidoctor-extensions` and could be used like: `asciidoctor -r /usr/local/asciidoctor-extensions/lib/glob-include-processor.rb ...` \ ⚠ Please do not use this code in production. The code is untested. * [asciidoctor-multipage](https://github.com/owenh000/asciidoctor-multipage) @@ -68,6 +69,7 @@ The following diagram tools are not installed because there is no executable fil ## Usage Generate HTML document: + ```bash docker run --rm \ -v $(pwd)/src/doc:/documents/ \ @@ -83,6 +85,7 @@ docker run --rm \ ``` Generate inlined HTML document via `inliner` based on generated HTML document: + ```bash docker run --rm -it \ -v $(pwd)/dist:/dist \ @@ -96,6 +99,7 @@ docker run --rm -it \ ``` Generate PDF document: + ```bash docker run --rm \ -v $(pwd)/src/doc:/documents/ \ @@ -120,5 +124,6 @@ docker build \ --tag docker.io/uwebarthel/asciidoctor:latest \ . ``` + --- [1] provided by original Asciidoctor Docker Image