Skip to content

Commit

Permalink
Update Dockerfile to support arm, arm64 and amd64 architecture
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenlafl authored Feb 23, 2024
1 parent 685c3b8 commit e6afa5f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
FROM alpine:3.17
MAINTAINER Serhiy Mitrovtsiy <[email protected]>

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/*

Expand Down

0 comments on commit e6afa5f

Please sign in to comment.