Skip to content

Commit

Permalink
Use pre-built Docker image for erd (#1754)
Browse files Browse the repository at this point in the history
  • Loading branch information
felixvanoost committed Aug 19, 2024
1 parent 3580756 commit d96fd25
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 32 deletions.
3 changes: 1 addition & 2 deletions ci/tasks/update-versions.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ try {
const { version } = d2VersionFound.groups
diagramLibraryVersions.d2 = version
}
const erdVersionFound = line.match(/^FROM yuzutech\/kroki-builder-erd:(?<version>\S+) AS kroki-builder-static-erd$/)
const erdVersionFound = line.match(/^FROM ghcr.io\/yuzutech\/erd:v(?<version>\S+) AS erd$/)
if (erdVersionFound) {
const { version } = erdVersionFound.groups
diagramLibraryVersions.erd = version
Expand All @@ -159,7 +159,6 @@ try {
const { version } = pikchrVersionFound.groups
diagramLibraryVersions.pikchr = version.slice(0, 10)
}

const symbolatorVersionFound = line.match(/^ARG SYMBOLATOR_VERSION=(?<version>.+)$/)
if (symbolatorVersionFound) {
const { version } = symbolatorVersionFound.groups
Expand Down
33 changes: 3 additions & 30 deletions server/ops/docker/jdk17-noble/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d96fd25

Please sign in to comment.