Skip to content

Commit

Permalink
Merge pull request #15 from kubesphere/revert-14-update-kubectl-Docke…
Browse files Browse the repository at this point in the history
…rfile

Revert "feat: support helm plugin mapkubeapis"
  • Loading branch information
wansir authored Mar 13, 2024
2 parents 338bf9d + 7631364 commit f2db072
Showing 1 changed file with 8 additions and 17 deletions.
25 changes: 8 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
FROM alpine:3.18.2
From alpine:3.18.2

ARG KUBECTL_VERSION=v1.27.4
ARG HELM_VERSION=v3.12.2
ARG KUSTOMIZE_VERSION=v5.1.0
ARG TARGETOS
ARG TARGETARCH

Expand All @@ -15,27 +14,19 @@ RUN apk update && apk add \
curl \
wget \
tcpdump \
git \
ca-certificates && \
update-ca-certificates && \
rm -rf /var/cache/apk/* && \
curl -LO https://storage.googleapis.com/kubernetes-release/release/${KUBECTL_VERSION}/bin/${TARGETOS}/${TARGETARCH}/kubectl && \
chmod +x ./kubectl && \
mv ./kubectl /usr/local/bin/kubectl && \
echo -e 'source /usr/share/bash-completion/bash_completion\nsource <(kubectl completion bash)' >>~/.bashrc && \
curl -SsLO https://get.helm.sh/helm-${HELM_VERSION}-${TARGETOS}-${TARGETARCH}.tar.gz && \
tar xf helm-${HELM_VERSION}-${TARGETOS}-${TARGETARCH}.tar.gz -C /usr/local/bin && \
tar xf helm-${HELM_VERSION}-${TARGETOS}-${TARGETARCH}.tar.gz -C /usr/local/bin && \
mv /usr/local/bin/${TARGETOS}-${TARGETARCH}/helm /usr/local/bin && \
rm helm-${HELM_VERSION}-${TARGETOS}-${TARGETARCH}.tar.gz && \
rm -rf /usr/local/bin/${TARGETOS}-${TARGETARCH} && \
helm plugin install https://github.com/helm/helm-mapkubeapis && \
apk del git

RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/${KUBECTL_VERSION}/bin/${TARGETOS}/${TARGETARCH}/kubectl && \
chmod +x ./kubectl && \
mv ./kubectl /usr/local/bin/kubectl && \
echo -e 'source /usr/share/bash-completion/bash_completion\nsource <(kubectl completion bash)' >>~/.bashrc

RUN curl -SsLO https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/${KUSTOMIZE_VERSION}/kustomize_${KUSTOMIZE_VERSION}_${TARGETOS}_${TARGETARCH}.tar.gz && \
tar xvzf kustomize_${KUSTOMIZE_VERSION}_${TARGETOS}_${TARGETARCH}.tar.gz && \
mv kustomize /usr/local/bin/ && \
rm kustomize_${KUSTOMIZE_VERSION}_${TARGETOS}_${TARGETARCH}.tar.gz
rm -rf /usr/local/bin/${TARGETOS}-${TARGETARCH}


COPY entrypoint.sh /usr/local/bin/entrypoint.sh

Expand Down

0 comments on commit f2db072

Please sign in to comment.