From 753da93c50187ac3d65d7f0bcca8b2d2af650090 Mon Sep 17 00:00:00 2001 From: Fabian Christoffel Date: Tue, 19 Oct 2021 20:27:11 +0200 Subject: [PATCH 1/2] Make it run on arm64 (Apple M1) --- Dockerfile | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 283c892..67519f0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:bullseye as compile-lkd +FROM golang:bullseye as compile-lkd MAINTAINER Marios Andreopoulos RUN apt-get update \ @@ -9,8 +9,10 @@ RUN apt-get update \ && rm -rf /var/lib/apt/lists/* \ && echo "progress = dot:giga" | tee /etc/wgetrc \ && mkdir -p /mnt /opt /data \ - && wget https://github.com/andmarios/duphard/releases/download/v1.0/duphard -O /bin/duphard \ - && chmod +x /bin/duphard + && go install github.com/andmarios/duphard@latest \ + && go install gitlab.com/andmarios/checkport@latest \ + && go install github.com/andmarios/quickcert@latest \ + && ln -s /go/bin/duphard /bin/duphard SHELL ["/bin/bash", "-c"] WORKDIR / @@ -324,6 +326,9 @@ CMD ["bash", "-c", "tar -czf /mnt/LKD-${LKD_VERSION}.tar.gz -C /opt landoop; cho FROM debian:bullseye-slim MAINTAINER Marios Andreopoulos COPY --from=compile-lkd /opt /opt +COPY --from=compile-lkd /go/bin/checkport /usr/local/bin/checkport +COPY --from=compile-lkd /go/bin/quickcert /usr/local/bin/quickcert + # Update, install tooling and some basic setup RUN apt-get update \ @@ -365,15 +370,10 @@ WORKDIR / # caddy : an excellent web server we use to serve fast-data-dev UI, proxy various REST # endpoints, etc # https://github.com/mholt/caddy -ARG CHECKPORT_URL="https://gitlab.com/andmarios/checkport/uploads/3903dcaeae16cd2d6156213d22f23509/checkport" -ARG QUICKCERT_URL="https://github.com/andmarios/quickcert/releases/download/1.0/quickcert-1.0-linux-amd64-alpine" ARG GLIBC_INST_VERSION="2.32-r0" -ARG CADDY_URL=https://github.com/caddyserver/caddy/releases/download/v0.11.5/caddy_v0.11.5_linux_amd64.tar.gz -ARG GOTTY_URL=https://github.com/yudai/gotty/releases/download/v1.0.1/gotty_linux_amd64.tar.gz -RUN wget "$CHECKPORT_URL" -O /usr/local/bin/checkport \ - && wget "$QUICKCERT_URL" -O /usr/local/bin/quickcert \ - && chmod 0755 /usr/local/bin/quickcert /usr/local/bin/checkport \ - && wget "$CADDY_URL" -O /caddy.tgz \ +ARG CADDY_URL=https://github.com/caddyserver/caddy/releases/download/v0.11.5/caddy_v0.11.5_linux_arm64.tar.gz +ARG GOTTY_URL=https://github.com/yudai/gotty/releases/download/v1.0.1/gotty_linux_arm.tar.gz +RUN wget "$CADDY_URL" -O /caddy.tgz \ && mkdir -p /opt/caddy \ && tar xzf /caddy.tgz -C /opt/caddy \ && rm -f /caddy.tgz \ From af051c486293b7caff4f0aa7473ed4e777536e11 Mon Sep 17 00:00:00 2001 From: Doug Donohoe Date: Thu, 7 Jul 2022 15:37:05 -0400 Subject: [PATCH 2/2] Leveraging faberchri work, modify so it can support amd64 and arm64 --- Dockerfile | 24 +++++++++++++++++++++--- README.md | 13 +++++++++++++ 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 67519f0..37bd1e9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -371,9 +371,27 @@ WORKDIR / # endpoints, etc # https://github.com/mholt/caddy ARG GLIBC_INST_VERSION="2.32-r0" -ARG CADDY_URL=https://github.com/caddyserver/caddy/releases/download/v0.11.5/caddy_v0.11.5_linux_arm64.tar.gz -ARG GOTTY_URL=https://github.com/yudai/gotty/releases/download/v1.0.1/gotty_linux_arm.tar.gz -RUN wget "$CADDY_URL" -O /caddy.tgz \ +ARG CADDY_URL_AMD64=https://github.com/caddyserver/caddy/releases/download/v0.11.5/caddy_v0.11.5_linux_amd64.tar.gz +ARG GOTTY_URL_AMD64=https://github.com/yudai/gotty/releases/download/v1.0.1/gotty_linux_amd64.tar.gz +ARG CADDY_URL_ARM64=https://github.com/caddyserver/caddy/releases/download/v0.11.5/caddy_v0.11.5_linux_arm64.tar.gz +ARG GOTTY_URL_ARM64=https://github.com/yudai/gotty/releases/download/v1.0.1/gotty_linux_arm.tar.gz +RUN set -eux; \ + dpkgArch="$(dpkg --print-architecture)"; \ + dir=/usr/local/src; \ + CADDY_URL=; \ + GOTTY_URL=; \ + case "${dpkgArch##*-}" in \ + 'amd64') \ + CADDY_URL="$CADDY_URL_AMD64"; \ + GOTTY_URL="$GOTTY_URL_AMD64"; \ + ;; \ + 'arm64') \ + CADDY_URL="$CADDY_URL_ARM64"; \ + GOTTY_URL="$GOTTY_URL_ARM64"; \ + ;; \ + *) echo >&2 "error: unsupported architecture '$dpkgArch' (likely packaging update needed)"; exit 1 ;; \ + esac; \ + wget "$CADDY_URL" -O /caddy.tgz \ && mkdir -p /opt/caddy \ && tar xzf /caddy.tgz -C /opt/caddy \ && rm -f /caddy.tgz \ diff --git a/README.md b/README.md index 37fb76f..26c15c2 100644 --- a/README.md +++ b/README.md @@ -462,3 +462,16 @@ environment variable: JMX ports are hardcoded to `9581` for the broker, `9582` for schema registry, `9583` for REST proxy and `9584` for connect distributed. Zookeeper is exposed at `9585`. + +## Development Notes + +**NOTE**: Not sure where this would go in an accepted PR. + +Building a multiple-architecture image requires using the Docker `buildx` plugin: + +```shell +docker buildx create --name builder-fast-data-dev +docker buildx build --platform linux/amd64,linux/arm64 \ + --tag your-docker-repo/fast-data-dev:latest \ + --pull --push --builder builder-fast-data-dev . +``` \ No newline at end of file