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

Commit

Permalink
Merge pull request #42 from epics-containers/tidymain
Browse files Browse the repository at this point in the history
simplify k8s tools install
  • Loading branch information
gilesknap authored May 26, 2023
2 parents d63112d + 7f2e1a0 commit af9bc76
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@

FROM ubuntu:22.04 as setup

ARG TARGETARCH
ENV TARGETARCH=amd64

RUN DEBIAN_FRONTEND=noninteractive \
apt-get update && apt-get upgrade -y && \
apt-get install -yq --no-install-recommends \
Expand Down Expand Up @@ -34,20 +37,17 @@ RUN DEBIAN_FRONTEND=noninteractive \
########## add kubernetes cli tools ############################################

# kubectl
RUN curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg && \
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 && \
apt-get update && \
apt-get install -y kubectl
RUN echo target architecture is ${TARGETARCH} && \
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/${TARGETARCH}/kubectl" && \
install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl

# helm
RUN curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | tee /usr/share/keyrings/helm.gpg > /dev/null && \
apt-get install apt-transport-https --yes && \
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 && \
apt-get update && \
apt-get install helm
RUN curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 && \
chmod 700 get_helm.sh && \
./get_helm.sh

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

Expand Down

0 comments on commit af9bc76

Please sign in to comment.