support arm arch for kiwix-serve image

This commit is contained in:
renaud gaudin 2020-08-31 09:42:15 +02:00
parent b2c68d7f22
commit 8cc34782bc

View File

@ -1,10 +1,17 @@
FROM alpine:latest
# declare build option ARCH
ARG ARCH=
# download ARCH-specific base image if specified
FROM ${ARCH}alpine:3
# decide which kiwix arch to download later (`armhf` for all arm* and x86_64 otherwise)
ARG ARCH
RUN if [ $(echo $ARCH | cut -c 1-3) = "arm" ] ; then echo "armhf" > /etc/kiwix_arch ; else echo "x86_64" > /etc/kiwix_arch ; fi
LABEL maintainer Emmanuel Engelhart <kelson@kiwix.org>
# Install kiwix-serve
ARG RELEASE_ARCH="x86_64"
WORKDIR /
RUN apk add --no-cache curl bzip2
RUN curl -kL https://download.kiwix.org/release/kiwix-tools/kiwix-tools_linux-x86_64.tar.gz | tar -xz && \
RUN curl -kL https://download.kiwix.org/release/kiwix-tools/kiwix-tools_linux-$(cat /etc/kiwix_arch).tar.gz | tar -xz && \
mv kiwix-tools*/kiwix-serve /usr/local/bin && \
rm -r kiwix-tools*