Merge pull request #34 from stevenlafl/master

Update Dockerfile to support arm, arm64 and amd64 architecture
This commit is contained in:
Serhiy Mytrovtsiy 2024-09-23 11:34:50 +02:00 committed by GitHub
commit 331d2007ae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,13 +1,15 @@
FROM alpine:3.17 FROM alpine:3.17
MAINTAINER Serhiy Mitrovtsiy <mitrovtsiy@ukr.net> MAINTAINER Serhiy Mitrovtsiy <mitrovtsiy@ukr.net>
ARG TARGETPLATFORM
ARG KUBE_VERSION="v1.31.1" ARG KUBE_VERSION="v1.31.1"
COPY entrypoint.sh /entrypoint.sh COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh && \ RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then ARCHITECTURE=amd64; elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then ARCHITECTURE=arm; elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then ARCHITECTURE=arm64; else ARCHITECTURE=amd64; fi && \
chmod +x /entrypoint.sh && \
apk add --no-cache --update openssl curl ca-certificates && \ apk add --no-cache --update openssl curl ca-certificates && \
curl -L https://dl.k8s.io/release/$KUBE_VERSION/bin/linux/amd64/kubectl -o /usr/local/bin/kubectl && \ curl -L https://dl.k8s.io/release/$KUBE_VERSION/bin/linux/$ARCHITECTURE/kubectl -o /usr/local/bin/kubectl && \
chmod +x /usr/local/bin/kubectl && \ chmod +x /usr/local/bin/kubectl && \
rm -rf /var/cache/apk/* rm -rf /var/cache/apk/*