Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace ERD (Haskell) with erd-go #343 #344

Merged
merged 6 commits into from
Mar 26, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 8 additions & 23 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,30 +45,13 @@ RUN apk add --no-cache ruby \
"asciidoctor-pdf:${ASCIIDOCTOR_PDF_VERSION}"

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Haskell build for: erd
# Install erd-go (https://github.com/kaishuu0123/erd-go) as replacement for erd (https://github.com/BurntSushi/erd)
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Alpine 3.16 is the last known working version for building erd (dynamic linking)
FROM alpine:3.16 AS erd-builder
FROM golang:alpine as erd-builder
barthel marked this conversation as resolved.
Show resolved Hide resolved
RUN apk add git \
barthel marked this conversation as resolved.
Show resolved Hide resolved
&& go install github.com/kaishuu0123/erd-go@v2.0.0
barthel marked this conversation as resolved.
Show resolved Hide resolved

## Always use the latest dependencies available for the current Alpine distribution
# hadolint ignore=DL3018
RUN apk add --no-cache \
alpine-sdk \
cabal \
ghc-dev \
ghc \
gmp-dev \
gnupg \
libffi-dev \
linux-headers \
perl-utils \
wget \
xz \
zlib-dev \
&& cabal v2-update \
&& cabal v2-install erd

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # \
# Final image
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
FROM main-minimal AS main
Expand Down Expand Up @@ -139,7 +122,9 @@ RUN apk add --no-cache \
seqdiag \
&& apk del -r --no-cache .pythonmakedepends

COPY --from=erd-builder /root/.cabal/bin/erd /bin/
COPY --from=erd-builder /go/bin/erd-go /usr/local/bin/
# for backward compatibility
RUN ln -snf /usr/local/bin/erd-go /usr/local/bin/erd

WORKDIR /documents
VOLUME /documents
Expand Down
2 changes: 2 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ This image uses Alpine Linux {ALPINE_VERSION} as base image.

NOTE: Docker Engine link:https://docs.docker.com/engine/release-notes/#20100[20.10] or later is required (or any container engine supporting link:https://wiki.alpinelinux.org/wiki/Release_Notes_for_Alpine_3.14.0[Alpine 3.14]) to avoid unexpected `No such file or directory` errors (such as link:https://github.com/asciidoctor/docker-asciidoctor/issues/214[#214] or link:https://github.com/asciidoctor/docker-asciidoctor/issues/215[#215]).

NOTE: This image uses the Go-based https://github.com/kaishuu0123/erd-go/[erd-go] instead of the original Haskell-based https://github.com/BurntSushi/erd[erd] to allow the Docker image to be provided as a multi-platform image.

== How to use it

Just run:
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ Docker Engine [20.10](https://docs.docker.com/engine/release-notes/#20100) or la

</div>

<div class="note">

This image uses the Go-based [erd-go](https://github.com/kaishuu0123/erd-go/) instead of the original Haskell-based [erd](https://github.com/BurntSushi/erd) to allow the Docker image to be provided as a multi-platform image.

</div>

## How to use it

Just run:
Expand Down