Skip to content

Commit 331d200

Browse files
authored
Merge pull request #34 from stevenlafl/master
Update Dockerfile to support arm, arm64 and amd64 architecture
2 parents ed2c67d + f014f00 commit 331d200

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Dockerfile

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
FROM alpine:3.17
22
MAINTAINER Serhiy Mitrovtsiy <mitrovtsiy@ukr.net>
33

4+
ARG TARGETPLATFORM
45
ARG KUBE_VERSION="v1.31.1"
56

67
COPY entrypoint.sh /entrypoint.sh
78

8-
RUN chmod +x /entrypoint.sh && \
9+
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 && \
10+
chmod +x /entrypoint.sh && \
911
apk add --no-cache --update openssl curl ca-certificates && \
10-
curl -L https://dl.k8s.io/release/$KUBE_VERSION/bin/linux/amd64/kubectl -o /usr/local/bin/kubectl && \
12+
curl -L https://dl.k8s.io/release/$KUBE_VERSION/bin/linux/$ARCHITECTURE/kubectl -o /usr/local/bin/kubectl && \
1113
chmod +x /usr/local/bin/kubectl && \
1214
rm -rf /var/cache/apk/*
1315

0 commit comments

Comments
 (0)