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

Docker images for new architectures #622

Merged
merged 1 commit into from
Jun 16, 2023
Merged
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
8 changes: 6 additions & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ jobs:
VERSION={tag}
platforms: |
linux/amd64
linux/arm/v7
linux/arm64
linux/arm/v7
linux/arm/v6
linux/386
restrict-to: kiwix/kiwix-tools
manual-tag: ${{ github.event.inputs.version }}
repo_description: auto
Expand All @@ -55,8 +57,10 @@ jobs:
VERSION={tag}
platforms: |
linux/amd64
linux/arm/v7
linux/arm64
linux/arm/v7
linux/arm/v6
linux/386
restrict-to: kiwix/kiwix-tools
manual-tag: ${{ github.event.inputs.version }}
repo_description: auto
Expand Down
5 changes: 5 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Unreleased
==========

* Additional docker images archs for armv6 and i386.

kiwix-tools 3.5.0
=================

Expand Down
25 changes: 19 additions & 6 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
FROM alpine:3.16
FROM alpine:3.18
LABEL org.opencontainers.image.source https://github.com/openzim/kiwix-tools

# TARGETPLATFORM is injected by docker build
ARG TARGETPLATFORM
ARG VERSION

RUN apk --no-cache add dumb-init curl && \
ARCH=$(cat /etc/apk/arch) && \
if [ "$ARCH" = "x86" ]; then ARCH="i586"; \
elif [ "$ARCH" = "aarch64" ]; then ARCH="armhf"; \
elif [ "$ARCH" = "armv7" ]; then ARCH="armhf"; fi && \
RUN set -e && \
apk --no-cache add dumb-init curl && \
echo "TARGETPLATFORM: $TARGETPLATFORM" && \
if [ "$TARGETPLATFORM" = "linux/386" ]; then ARCH="i586"; \
# linux/arm64/v8 points to linux/arm64
elif [ "$TARGETPLATFORM" = "linux/arm64/v8" \
-o "$TARGETPLATFORM" = "linux/arm64" ]; then ARCH="aarch64"; \
# linux/arm translates to linux/arm/v7
elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then ARCH="armv8"; \
elif [ "$TARGETPLATFORM" = "linux/arm/v6" ]; then ARCH="armv6"; \
elif [ "$TARGETPLATFORM" = "linux/amd64/v3" \
-o "$TARGETPLATFORM" = "linux/amd64/v2" \
-o "$TARGETPLATFORM" = "linux/amd64" ]; then ARCH="x86_64"; \
# we dont suppot any other arch so let it fail
else ARCH="unknown"; fi && \
# download requested kiwix-tools version
url="http://mirror.download.kiwix.org/release/kiwix-tools/kiwix-tools_linux-$ARCH-$VERSION.tar.gz" && \
echo "URL: $url" && \
Expand Down