diff --git a/Dockerfile b/Dockerfile index aefd66d..bb4d623 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,15 @@ FROM alpine:3.17 MAINTAINER Serhiy Mitrovtsiy +ARG TARGETPLATFORM ARG KUBE_VERSION="v1.29.2" 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 && \ - curl -L https://storage.googleapis.com/kubernetes-release/release/$KUBE_VERSION/bin/linux/amd64/kubectl -o /usr/local/bin/kubectl && \ + curl -L https://storage.googleapis.com/kubernetes-release/release/$KUBE_VERSION/bin/linux/$ARCHITECTURE/kubectl -o /usr/local/bin/kubectl && \ chmod +x /usr/local/bin/kubectl && \ rm -rf /var/cache/apk/*