Skip to content
This repository was archived by the owner on Jul 31, 2024. It is now read-only.

Commit af9bc76

Browse files
authored
Merge pull request #42 from epics-containers/tidymain
simplify k8s tools install
2 parents d63112d + 7f2e1a0 commit af9bc76

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

docker/Dockerfile

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55

66
FROM ubuntu:22.04 as setup
77

8+
ARG TARGETARCH
9+
ENV TARGETARCH=amd64
10+
811
RUN DEBIAN_FRONTEND=noninteractive \
912
apt-get update && apt-get upgrade -y && \
1013
apt-get install -yq --no-install-recommends \
@@ -34,20 +37,17 @@ RUN DEBIAN_FRONTEND=noninteractive \
3437
########## add kubernetes cli tools ############################################
3538

3639
# kubectl
37-
RUN curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg && \
38-
echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | tee /etc/apt/sources.list.d/kubernetes.list && \
39-
apt-get update && \
40-
apt-get install -y kubectl
40+
RUN echo target architecture is ${TARGETARCH} && \
41+
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/${TARGETARCH}/kubectl" && \
42+
install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
4143

4244
# helm
43-
RUN curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | tee /usr/share/keyrings/helm.gpg > /dev/null && \
44-
apt-get install apt-transport-https --yes && \
45-
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian/ all main" | tee /etc/apt/sources.list.d/helm-stable-debian.list && \
46-
apt-get update && \
47-
apt-get install helm
45+
RUN curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 && \
46+
chmod 700 get_helm.sh && \
47+
./get_helm.sh
4848

4949
# oidc-login
50-
RUN curl -L https://github.com/int128/kubelogin/releases/download/v1.25.3/kubelogin_linux_amd64.zip --output /tmp/kubelogin.zip && \
50+
RUN curl -L "https://github.com/int128/kubelogin/releases/download/v1.27.0/kubelogin_linux_${TARGETARCH}.zip" --output /tmp/kubelogin.zip && \
5151
unzip /tmp/kubelogin.zip kubelogin && \
5252
mv kubelogin /usr/local/bin/kubectl-oidc_login
5353

0 commit comments

Comments
 (0)