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

feature(main): support arm64 platform #33

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
6 changes: 3 additions & 3 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
- "[0-9]+.[0-9]+-[0-9]+.[0-9]+.[0-9]+"
# pull_request:
env:
PLATFORMS: linux/amd64
PLATFORMS: linux/amd64,linux/arm64
jobs:
docker:
name: Docker
Expand Down Expand Up @@ -45,9 +45,9 @@ jobs:
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
- name: Build Apache Kafka
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
tags: ghcr.io/banzaicloud/kafka:${{ steps.imagetag.outputs.value }}
tags: ghcr.io/${{ github.repository_owner }}/kafka:${{ steps.imagetag.outputs.value }}
file: Dockerfile
platforms: ${{ env.PLATFORMS }}
push: true
Expand Down
28 changes: 19 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,28 @@ ARG kafka_version=3.4.1
ARG kafka_distro_base_url=https://dlcdn.apache.org/kafka

ENV kafka_distro=kafka_$scala_version-$kafka_version.tgz
ENV kafka_distro_asc=$kafka_distro.asc

RUN apk add --no-cache gnupg
ENV kafka_distro_sha512=$kafka_distro.sha512

WORKDIR /var/tmp

RUN apk add --no-cache coreutils
RUN wget -q $kafka_distro_base_url/$kafka_version/$kafka_distro
RUN wget -q $kafka_distro_base_url/$kafka_version/$kafka_distro_asc
RUN wget -q $kafka_distro_base_url/KEYS

RUN gpg --import KEYS
RUN gpg --verify $kafka_distro_asc $kafka_distro
RUN wget -q $kafka_distro_base_url/$kafka_version/$kafka_distro_sha512
RUN set -e; \
# Calculate the SHA-512 checksum of the downloaded file
calculated_checksum=$(sha512sum $kafka_distro | awk '{print $1}'); \
\
# Extract and format the provided SHA-512 checksum from the file
provided_checksum=$(tr -d ' \n' < $kafka_distro_sha512 | cut -d':' -f2 | tr 'A-F' 'a-f'); \
\
echo "Calculated checksum: $calculated_checksum"; \
echo "Provided checksum: $provided_checksum"; \
# Compare the two checksums and exit if they don't match
if [ "$calculated_checksum" != "$provided_checksum" ]; then \
echo "SHA-512 values do NOT match!"; \
exit 1; \
else \
echo "SHA-512 values match!"; \
fi

RUN tar -xzf $kafka_distro
RUN rm -r kafka_$scala_version-$kafka_version/bin/windows
Expand Down