diff --git a/Dockerfile b/Dockerfile index 61fe175..94eeba8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,8 @@ -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 @@ -14,19 +15,27 @@ 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} - + 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 COPY entrypoint.sh /usr/local/bin/entrypoint.sh