From 14284b871d6a8de80d383bf5069935c535136f3c Mon Sep 17 00:00:00 2001 From: Felix van Oost Date: Mon, 12 Aug 2024 19:50:41 -0400 Subject: [PATCH 1/8] Use dvisvgm apt package --- server/ops/docker/jdk17-jammy/Dockerfile | 61 +++++------------------- 1 file changed, 13 insertions(+), 48 deletions(-) diff --git a/server/ops/docker/jdk17-jammy/Dockerfile b/server/ops/docker/jdk17-jammy/Dockerfile index 9770f1d4b..51605898b 100644 --- a/server/ops/docker/jdk17-jammy/Dockerfile +++ b/server/ops/docker/jdk17-jammy/Dockerfile @@ -1,41 +1,5 @@ # syntax=docker/dockerfile:1.4 -## TikZ -FROM --platform=$BUILDPLATFORM ubuntu:jammy AS kroki-builder-dvisvgm - -RUN apt-get update && apt-get install --no-install-recommends --yes \ - build-essential \ - pkg-config \ - libclipper-dev \ - libfreetype-dev \ - libkpathsea-dev \ - ghostscript \ - libssl-dev \ - zlib1g-dev \ - curl \ - ca-certificates - -ARG DVISVGM_VERSION=3.0.4 - -ARG BUILDARCH -ARG TARGETARCH -RUN curl -LO https://github.com/mgieseki/dvisvgm/releases/download/$DVISVGM_VERSION/dvisvgm-$DVISVGM_VERSION.tar.gz && \ - tar xf dvisvgm-$DVISVGM_VERSION.tar.gz && \ - cd dvisvgm-$DVISVGM_VERSION && \ - case $BUILDARCH in \ - "amd64") MAKE_BUILD_ARCH=x86_64 ;; \ - "arm64") MAKE_BUILD_ARCH=aarch64 ;; \ - *) MAKE_BUILD_ARCH=$TARGETARCH ;; \ - esac && \ - case $TARGETARCH in \ - "amd64") MAKE_TARGET_ARCH=x86_64 ;; \ - "arm64") MAKE_TARGET_ARCH=aarch64 ;; \ - *) MAKE_TARGET_ARCH=$TARGETARCH ;; \ - esac && \ - ./configure --enable-bundled-libs --build $MAKE_BUILD_ARCH-linux-gnu --host $MAKE_TARGET_ARCH-linux-gnu && \ - make && \ - make install - ## Nomnoml FROM --platform=$BUILDPLATFORM node:18.20-bullseye-slim AS kroki-builder-nomnoml @@ -232,14 +196,15 @@ RUN SVGBOB_VERSION=`cat Cargo.toml | grep "svgbob_cli =" | sed -r 's/.*"([^"]+)" # use a pre-built image to reduce build time ## yuzutech/kroki -FROM eclipse-temurin:17.0.10_7-jre-jammy +FROM eclipse-temurin:17.0.12_7-jre-noble +ARG BLOCKDIAG_VERSION="3.1.0" ARG D2_VERSION="0.6.3" +ARG DITAA_VERSION="1.0.3" +ARG DVISVGM_VERSION="3.0.4" +ARG GRAPHVIZ_VERSION="9.0.0" ARG PLANTUML_VERSION="1.2024.1" ARG UMLET_VERSION="2023-03-20_UMLet_v15.1" -ARG GRAPHVIZ_VERSION="9.0.0" -ARG DITAA_VERSION="1.0.3" -ARG BLOCKDIAG_VERSION="3.1.0" ARG WIREVIZ_VERSION="0.3.3" ARG TARGETARCH @@ -255,16 +220,17 @@ RUN addgroup --gecos 1000 kroki && adduser --disabled-password --ingroup kroki - # * texlive-pictures - Provides various graphics packages like "circuitikz" # * texlive-science - Provides various science packages like "siunitx" RUN apt-get update && apt-get install --no-install-recommends --yes \ - libpangocairo-1.0 \ - libgd3 \ - libjpeg9 \ - libpango1.0-0 \ - giflib-tools \ + dvisvgm=$DVISVGM_VERSION \ fonts-freefont-ttf \ - fonts-noto-cjk \ fonts-liberation \ - gsfonts \ + fonts-noto-cjk \ ghostscript \ + giflib-tools \ + gsfonts \ + libgd3 \ + libjpeg9 \ + libpango1.0-0 \ + libpangocairo-1.0 \ poppler-utils \ texlive \ texlive-latex-extra \ @@ -304,7 +270,6 @@ COPY --from=kroki-builder-dbml /app/app.bin /usr/bin/dbml COPY --from=kroki-builder-wavedrom /app/app.bin /usr/bin/wavedrom COPY --from=kroki-builder-static-symbolator /build/symbolator.bin /usr/bin/symbolator COPY --from=kroki-builder-bytefield /app/app.bin /usr/bin/bytefield -COPY --from=kroki-builder-dvisvgm /usr/local/bin/dvisvgm /usr/bin/dvisvgm COPY --from=tikz tikz2svg /usr/bin/tikz2svg COPY --chown=kroki:kroki ops/docker/logback.xml /etc/kroki/logback.xml From 8185f024ce571186d44fc651dac64f8ea9d23f59 Mon Sep 17 00:00:00 2001 From: Felix van Oost Date: Mon, 12 Aug 2024 20:25:47 -0400 Subject: [PATCH 2/8] Use groupadd instead of addgroup --- server/ops/docker/jdk17-jammy/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/ops/docker/jdk17-jammy/Dockerfile b/server/ops/docker/jdk17-jammy/Dockerfile index 51605898b..7c852ce36 100644 --- a/server/ops/docker/jdk17-jammy/Dockerfile +++ b/server/ops/docker/jdk17-jammy/Dockerfile @@ -208,7 +208,7 @@ ARG UMLET_VERSION="2023-03-20_UMLet_v15.1" ARG WIREVIZ_VERSION="0.3.3" ARG TARGETARCH -RUN addgroup --gecos 1000 kroki && adduser --disabled-password --ingroup kroki -u 1000 kroki +RUN groupadd --gecos 1000 kroki && adduser --disabled-password --ingroup kroki -u 1000 kroki # For TikZ # From 0ac50bd5bde7e2835bbc2eda505c695153cb38a9 Mon Sep 17 00:00:00 2001 From: Felix van Oost Date: Mon, 12 Aug 2024 20:31:47 -0400 Subject: [PATCH 3/8] Use useradd instead of adduser --- server/ops/docker/jdk17-jammy/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/ops/docker/jdk17-jammy/Dockerfile b/server/ops/docker/jdk17-jammy/Dockerfile index 7c852ce36..bf81730f2 100644 --- a/server/ops/docker/jdk17-jammy/Dockerfile +++ b/server/ops/docker/jdk17-jammy/Dockerfile @@ -208,7 +208,7 @@ ARG UMLET_VERSION="2023-03-20_UMLet_v15.1" ARG WIREVIZ_VERSION="0.3.3" ARG TARGETARCH -RUN groupadd --gecos 1000 kroki && adduser --disabled-password --ingroup kroki -u 1000 kroki +RUN groupadd --gecos 1000 kroki && useradd --disabled-password --ingroup kroki -u 1000 kroki # For TikZ # From 7eb091287e17f6faf49a0523f122b8d45281a186 Mon Sep 17 00:00:00 2001 From: Felix van Oost Date: Mon, 12 Aug 2024 21:30:53 -0400 Subject: [PATCH 4/8] Install adduser package in base image --- server/ops/docker/jdk17-jammy/Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/ops/docker/jdk17-jammy/Dockerfile b/server/ops/docker/jdk17-jammy/Dockerfile index bf81730f2..227847f9b 100644 --- a/server/ops/docker/jdk17-jammy/Dockerfile +++ b/server/ops/docker/jdk17-jammy/Dockerfile @@ -208,7 +208,9 @@ ARG UMLET_VERSION="2023-03-20_UMLet_v15.1" ARG WIREVIZ_VERSION="0.3.3" ARG TARGETARCH -RUN groupadd --gecos 1000 kroki && useradd --disabled-password --ingroup kroki -u 1000 kroki +RUN apt-get update && apt-get install --no-install-recommends --yes \ + adduser && \ + addgroup --gecos 1000 kroki && adduser --disabled-password --ingroup kroki -u 1000 kroki # For TikZ # From c185e8dbc46420faa30b076984e4c8edfe8f8262 Mon Sep 17 00:00:00 2001 From: Felix van Oost Date: Tue, 13 Aug 2024 18:22:19 -0400 Subject: [PATCH 5/8] Set GUID to 1001 --- server/ops/docker/jdk17-jammy/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/ops/docker/jdk17-jammy/Dockerfile b/server/ops/docker/jdk17-jammy/Dockerfile index 227847f9b..9b764d27a 100644 --- a/server/ops/docker/jdk17-jammy/Dockerfile +++ b/server/ops/docker/jdk17-jammy/Dockerfile @@ -210,7 +210,7 @@ ARG TARGETARCH RUN apt-get update && apt-get install --no-install-recommends --yes \ adduser && \ - addgroup --gecos 1000 kroki && adduser --disabled-password --ingroup kroki -u 1000 kroki + addgroup --gecos 1001 kroki && adduser --disabled-password --ingroup kroki -u 1001 kroki # For TikZ # From bc6cb65d6d4c25797f76317d104b649eff88f155 Mon Sep 17 00:00:00 2001 From: Felix van Oost Date: Tue, 13 Aug 2024 18:31:38 -0400 Subject: [PATCH 6/8] Update apt dependencies --- server/ops/docker/jdk17-jammy/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/ops/docker/jdk17-jammy/Dockerfile b/server/ops/docker/jdk17-jammy/Dockerfile index 9b764d27a..b7a41b325 100644 --- a/server/ops/docker/jdk17-jammy/Dockerfile +++ b/server/ops/docker/jdk17-jammy/Dockerfile @@ -201,7 +201,7 @@ FROM eclipse-temurin:17.0.12_7-jre-noble ARG BLOCKDIAG_VERSION="3.1.0" ARG D2_VERSION="0.6.3" ARG DITAA_VERSION="1.0.3" -ARG DVISVGM_VERSION="3.0.4" +ARG DVISVGM_VERSION="3.2.1" ARG GRAPHVIZ_VERSION="9.0.0" ARG PLANTUML_VERSION="1.2024.1" ARG UMLET_VERSION="2023-03-20_UMLet_v15.1" @@ -231,8 +231,8 @@ RUN apt-get update && apt-get install --no-install-recommends --yes \ gsfonts \ libgd3 \ libjpeg9 \ - libpango1.0-0 \ - libpangocairo-1.0 \ + libpango-1.0-0 \ + libpangocairo-1.0-0 \ poppler-utils \ texlive \ texlive-latex-extra \ From 5a3df24cf9d84c5eeedaa4fef3366146c4742cff Mon Sep 17 00:00:00 2001 From: Felix van Oost Date: Tue, 13 Aug 2024 18:52:43 -0400 Subject: [PATCH 7/8] Use exact dvisvgm version --- server/ops/docker/jdk17-jammy/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/ops/docker/jdk17-jammy/Dockerfile b/server/ops/docker/jdk17-jammy/Dockerfile index b7a41b325..335ff5afc 100644 --- a/server/ops/docker/jdk17-jammy/Dockerfile +++ b/server/ops/docker/jdk17-jammy/Dockerfile @@ -201,7 +201,7 @@ FROM eclipse-temurin:17.0.12_7-jre-noble ARG BLOCKDIAG_VERSION="3.1.0" ARG D2_VERSION="0.6.3" ARG DITAA_VERSION="1.0.3" -ARG DVISVGM_VERSION="3.2.1" +ARG DVISVGM_VERSION="3.2.1+ds-1build1" ARG GRAPHVIZ_VERSION="9.0.0" ARG PLANTUML_VERSION="1.2024.1" ARG UMLET_VERSION="2023-03-20_UMLet_v15.1" From 573471bb4556d4d83d26ecb1f96eb569cd95fbe5 Mon Sep 17 00:00:00 2001 From: Felix van Oost Date: Sun, 18 Aug 2024 05:48:32 +0000 Subject: [PATCH 8/8] Update all builder images to Ubuntu 24.04 --- ci/tasks/update-versions.js | 2 +- docker-bake.hcl | 2 +- server/README.adoc | 6 ++--- .../{jdk17-jammy => jdk17-noble}/Dockerfile | 25 +++++++++---------- 4 files changed, 17 insertions(+), 18 deletions(-) rename server/ops/docker/{jdk17-jammy => jdk17-noble}/Dockerfile (97%) diff --git a/ci/tasks/update-versions.js b/ci/tasks/update-versions.js index 21b87da97..e129438b6 100755 --- a/ci/tasks/update-versions.js +++ b/ci/tasks/update-versions.js @@ -142,7 +142,7 @@ try { diagramLibraryVersions.diagramsnet = [...diagramsnetVersionFound][0].groups.version } - const dockerfileContent = await fs.readFile(ospath.join(rootDir, 'server', 'ops', 'docker', 'jdk17-jammy', 'Dockerfile'), 'utf8') + const dockerfileContent = await fs.readFile(ospath.join(rootDir, 'server', 'ops', 'docker', 'jdk17-noble', 'Dockerfile'), 'utf8') for (const line of dockerfileContent.split('\n')) { const d2VersionFound = line.match(/^ARG D2_VERSION="(?.+)"$/) if (d2VersionFound) { diff --git a/docker-bake.hcl b/docker-bake.hcl index 87fa43729..553437b06 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -25,7 +25,7 @@ target "kroki" { bytefield = "./bytefield" tikz = "./tikz" } - dockerfile = "ops/docker/jdk17-jammy/Dockerfile" + dockerfile = "ops/docker/jdk17-noble/Dockerfile" tags = ["yuzutech/kroki:${TAG}"] inherits = ["oci-labels"] labels = { diff --git a/server/README.adoc b/server/README.adoc index 035b1d4ea..b273c038d 100644 --- a/server/README.adoc +++ b/server/README.adoc @@ -14,7 +14,7 @@ When a new version is available, we need to : . update the fork . run the following workflow: https://github.com/yuzutech/ditaa-mini/actions/workflows/native-image-on-demand.yml -. update the argument variable `ARG DITAA_VERSION="x.y.z"` in `server/ops/docker/jdk17-jammy/Dockerfile` +. update the argument variable `ARG DITAA_VERSION="x.y.z"` in `server/ops/docker/jdk17-noble/Dockerfile` === PlantUML @@ -24,7 +24,7 @@ When a new version is available, we need to: . update the fork . run the following workflow: https://github.com/yuzutech/plantuml/actions/workflows/native-image-on-demand.yml -. update the argument variable `ARG PLANTUML_VERSION="x.y.z"` in `server/ops/docker/jdk17-jammy/Dockerfile` +. update the argument variable `ARG PLANTUML_VERSION="x.y.z"` in `server/ops/docker/jdk17-noble/Dockerfile` === UMLet @@ -34,4 +34,4 @@ When a new version is available, we need to: . update the fork . run the following workflow: https://github.com/yuzutech/umlet/actions/workflows/release.yml -. update the argument variable `ARG UMLET_VERSION="x.y.z"` in `server/ops/docker/jdk17-jammy/Dockerfile` +. update the argument variable `ARG UMLET_VERSION="x.y.z"` in `server/ops/docker/jdk17-noble/Dockerfile` diff --git a/server/ops/docker/jdk17-jammy/Dockerfile b/server/ops/docker/jdk17-noble/Dockerfile similarity index 97% rename from server/ops/docker/jdk17-jammy/Dockerfile rename to server/ops/docker/jdk17-noble/Dockerfile index 335ff5afc..a97d2ebbe 100644 --- a/server/ops/docker/jdk17-jammy/Dockerfile +++ b/server/ops/docker/jdk17-noble/Dockerfile @@ -118,36 +118,35 @@ FROM yuzutech/kroki-builder-erd:0.2.1.0 AS kroki-builder-static-erd # --ghc-options="-w" ## Symbolator -FROM ubuntu:jammy AS kroki-builder-static-symbolator +FROM ubuntu:noble AS kroki-builder-static-symbolator # Build from forked source because upstream is broken for the latest python3 versions ARG SYMBOLATOR_VERSION=1.2.2 ARG SYMBOLATOR_SOURCE=git+https://github.com/zebreus/symbolator.git@v$SYMBOLATOR_VERSION RUN apt-get update && apt-get install --no-install-recommends --yes \ + build-essential \ git \ pip \ python3-dev \ patchelf \ python3-gi-cairo \ python3-gi \ - build-essential \ + python3-pip \ + python3-setuptools \ libpango1.0-dev && \ apt-get clean && apt-get autoremove WORKDIR /build -# Install latest pip and setuptools -RUN python3 -m pip install --upgrade pip setuptools -RUN python3 -m pip install --upgrade nuitka -# Install symbolator -RUN python3 -m pip install --upgrade ${SYMBOLATOR_SOURCE} +RUN python3 -m pip install --break-system-packages --upgrade nuitka +RUN python3 -m pip install --break-system-packages --upgrade ${SYMBOLATOR_SOURCE} # Use nuitka to compile a static binary so we dont need python in the final image RUN python3 -m nuitka --onefile `which symbolator` --include-module=gi.overrides.Pango --include-module=gi._gi_cairo ## Pikchr -FROM ubuntu:jammy AS kroki-builder-static-pikchr +FROM ubuntu:noble AS kroki-builder-static-pikchr ARG PIKCHR_VERSION=7269f78c4a3aa2809bd8c278e522c4eac5568ad0fd6ed0a3f807f4a2f6367ef0 @@ -263,15 +262,15 @@ RUN wget "https://github.com/yuzutech/blockdiag/releases/download/v${BLOCKDIAG_V RUN wget "https://github.com/yuzutech/WireViz/releases/download/v${WIREVIZ_VERSION}/wireviz-linux-${TARGETARCH}.bin" -O /usr/bin/wireviz && \ chmod +x /usr/bin/wireviz -COPY --from=kroki-builder-static-svgbob /usr/local/cargo/bin/svgbob_cli /usr/bin/svgbob +COPY --from=kroki-builder-bytefield /app/app.bin /usr/bin/bytefield +COPY --from=kroki-builder-dbml /app/app.bin /usr/bin/dbml +COPY --from=kroki-builder-nomnoml /app/app.bin /usr/bin/nomnoml COPY --from=kroki-builder-static-erd /root/.local/bin/erd /usr/bin/erd COPY --from=kroki-builder-static-pikchr /build/pikchr /usr/bin/pikchr -COPY --from=kroki-builder-nomnoml /app/app.bin /usr/bin/nomnoml +COPY --from=kroki-builder-static-svgbob /usr/local/cargo/bin/svgbob_cli /usr/bin/svgbob +COPY --from=kroki-builder-static-symbolator /build/symbolator.bin /usr/bin/symbolator COPY --from=kroki-builder-vega /app/app.bin /usr/bin/vega -COPY --from=kroki-builder-dbml /app/app.bin /usr/bin/dbml COPY --from=kroki-builder-wavedrom /app/app.bin /usr/bin/wavedrom -COPY --from=kroki-builder-static-symbolator /build/symbolator.bin /usr/bin/symbolator -COPY --from=kroki-builder-bytefield /app/app.bin /usr/bin/bytefield COPY --from=tikz tikz2svg /usr/bin/tikz2svg COPY --chown=kroki:kroki ops/docker/logback.xml /etc/kroki/logback.xml