From d96fd259e2362b39707bb5a8665ec81f2aaac4df Mon Sep 17 00:00:00 2001 From: Felix van Oost Date: Mon, 19 Aug 2024 04:09:39 -0400 Subject: [PATCH] Use pre-built Docker image for erd (#1754) --- ci/tasks/update-versions.js | 3 +-- server/ops/docker/jdk17-noble/Dockerfile | 33 +++--------------------- 2 files changed, 4 insertions(+), 32 deletions(-) diff --git a/ci/tasks/update-versions.js b/ci/tasks/update-versions.js index e129438b6..9195d509f 100755 --- a/ci/tasks/update-versions.js +++ b/ci/tasks/update-versions.js @@ -149,7 +149,7 @@ try { const { version } = d2VersionFound.groups diagramLibraryVersions.d2 = version } - const erdVersionFound = line.match(/^FROM yuzutech\/kroki-builder-erd:(?\S+) AS kroki-builder-static-erd$/) + const erdVersionFound = line.match(/^FROM ghcr.io\/yuzutech\/erd:v(?\S+) AS erd$/) if (erdVersionFound) { const { version } = erdVersionFound.groups diagramLibraryVersions.erd = version @@ -159,7 +159,6 @@ try { const { version } = pikchrVersionFound.groups diagramLibraryVersions.pikchr = version.slice(0, 10) } - const symbolatorVersionFound = line.match(/^ARG SYMBOLATOR_VERSION=(?.+)$/) if (symbolatorVersionFound) { const { version } = symbolatorVersionFound.groups diff --git a/server/ops/docker/jdk17-noble/Dockerfile b/server/ops/docker/jdk17-noble/Dockerfile index a97d2ebbe..85dd2c5e3 100644 --- a/server/ops/docker/jdk17-noble/Dockerfile +++ b/server/ops/docker/jdk17-noble/Dockerfile @@ -93,30 +93,6 @@ WORKDIR /app RUN npm install --target_arch=$([ "$TARGETARCH" = "amd64" ] && echo "x64" || echo "$TARGETARCH") --target_platform=$TARGETOS RUN /usr/local/bin/pkg --targets $NODE-$TARGETOS-$([ "$TARGETARCH" = "amd64" ] && echo "x64" || echo "$TARGETARCH") . -o app.bin -## ERD -# use a pre-built image to reduce build time -FROM yuzutech/kroki-builder-erd:0.2.1.0 AS kroki-builder-static-erd -#FROM ubuntu:18.04 AS kroki-builder-static-erd - -#ARG ERD_VERSION=0.2.1.0 - -#RUN apt-get -qq update && apt-get install -qq -y graphviz curl git > /dev/null - -#RUN curl -sSL https://get.haskellstack.org/ | sh -s - -q > /dev/null - -#RUN git clone https://github.com/BurntSushi/erd.git - -#WORKDIR erd - -#RUN git checkout "v${ERD_VERSION}" - -# build static executable binary -#RUN /usr/local/bin/stack install --silent --ghc-options="-fPIC" \ -# --ghc-options="-static" \ -# --ghc-options="-optl=-static" \ -# --ghc-options="-optc=-static" \ -# --ghc-options="-w" - ## Symbolator FROM ubuntu:noble AS kroki-builder-static-symbolator @@ -188,11 +164,8 @@ RUN SVGBOB_VERSION=`cat Cargo.toml | grep "svgbob_cli =" | sed -r 's/.*"([^"]+)" rustup target add $RUST_TARGET_ARCH-unknown-linux-gnu && \ cargo install --quiet --target $RUST_TARGET_ARCH-unknown-linux-gnu --version $SVGBOB_VERSION svgbob_cli -## UMlet -# use a pre-built image to reduce build time - -## PlantUML -# use a pre-built image to reduce build time +## Erd +FROM ghcr.io/yuzutech/erd:v0.2.3 AS erd ## yuzutech/kroki FROM eclipse-temurin:17.0.12_7-jre-noble @@ -262,10 +235,10 @@ 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=erd /root/.cabal/bin/erd /usr/bin/erd 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-static-svgbob /usr/local/cargo/bin/svgbob_cli /usr/bin/svgbob COPY --from=kroki-builder-static-symbolator /build/symbolator.bin /usr/bin/symbolator