Skip to content

Commit

Permalink
Remove TikZ because it's available in original Asciidoctor Docker ima…
Browse files Browse the repository at this point in the history
…ge since 1.78.0.
  • Loading branch information
barthel committed Oct 10, 2024
1 parent f30db7e commit ce1f051
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 17 deletions.
24 changes: 12 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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

# =========================================
Expand All @@ -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 <barthel@users.noreply.github.com>"
LABEL maintainers="barthel <barthel@users.noreply.github.com>"
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}"
Expand All @@ -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 \
Expand Down
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: <https://barthel.github.io/docker-asciidoctor/>

## ⚠️ Note

Expand Down Expand Up @@ -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)<sup>[1]</sup>
* [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. \
> &mdash;David Powell, https://github.com/BitLooter/htmlark
* [inliner](https://github.com/barthel/inliner) fork of https://github.com/remy/inliner
> &mdash;David Powell, <https://github.com/BitLooter/htmlark>
* [inliner](https://github.com/barthel/inliner) fork of <https://github.com/remy/inliner>
> 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.
> &mdash;Remy Sharp, https://github.com/remy/inliner
> &mdash;Remy Sharp, <https://github.com/remy/inliner>
* [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)
Expand All @@ -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/ \
Expand All @@ -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 \
Expand All @@ -96,6 +99,7 @@ docker run --rm -it \
```

Generate PDF document:

```bash
docker run --rm \
-v $(pwd)/src/doc:/documents/ \
Expand All @@ -120,5 +124,6 @@ docker build \
--tag docker.io/uwebarthel/asciidoctor:latest \
.
```

---
<sup>[1]</sup> provided by original Asciidoctor Docker Image

0 comments on commit ce1f051

Please sign in to comment.