github.com/GoogleContainerTools/skaffold@v1.39.18/deploy/skaffold/Dockerfile.lts (about) 1 # Copyright 2019 The Skaffold Authors All rights reserved. 2 # 3 # Licensed under the Apache License, Version 2.0 (the "License"); 4 # you may not use this file except in compliance with the License. 5 # You may obtain a copy of the License at 6 # 7 # http://www.apache.org/licenses/LICENSE-2.0 8 # 9 # Unless required by applicable law or agreed to in writing, software 10 # distributed under the License is distributed on an "AS IS" BASIS, 11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 # See the License for the specific language governing permissions and 13 # limitations under the License. 14 15 ARG ARCH=amd64 16 ARG SKAFFOLD_VERSION 17 18 # Download skaffold 19 FROM alpine:3.10 as download-skaffold 20 ARG ARCH 21 ARG SKAFFOLD_VERSION 22 ENV SKAFFOLD_URL https://storage.googleapis.com/skaffold/releases/${SKAFFOLD_VERSION}/skaffold-linux-${ARCH} 23 RUN wget -O skaffold "${SKAFFOLD_URL}" 24 RUN chmod +x skaffold 25 26 # Download kubectl 27 FROM alpine:3.10 as download-kubectl 28 ARG ARCH 29 # https://cloud.google.com/sdk/docs/release-notes 30 ENV KUBECTL_VERSION v1.27.2 31 ENV KUBECTL_URL https://storage.googleapis.com/kubernetes-release/release/${KUBECTL_VERSION}/bin/linux/${ARCH}/kubectl 32 # SHAs at gs://kubernetes-release/release/${KUBECTL_VERSION}/bin/linux/${ARCH}/ 33 COPY deploy/skaffold/digests/kubectl.${ARCH}.sha512 . 34 RUN wget -O kubectl "${KUBECTL_URL}" && sha512sum -c kubectl.${ARCH}.sha512 35 RUN chmod +x kubectl 36 37 # Download helm (see https://github.com/helm/helm/releases/latest) 38 FROM alpine:3.10 as download-helm 39 ARG ARCH 40 RUN echo arch=$ARCH 41 ENV HELM_VERSION v3.12.0 42 ENV HELM_URL https://storage.googleapis.com/skaffold/deps/helm/helm-${HELM_VERSION}-linux-${ARCH}.tar.gz 43 COPY deploy/skaffold/digests/helm.${ARCH}.sha256 . 44 RUN wget -O helm.tar.gz "${HELM_URL}" && sha256sum -c helm.${ARCH}.sha256 45 RUN tar -xvf helm.tar.gz --strip-components 1 46 47 # Download kustomize 48 FROM alpine:3.10 as download-kustomize 49 ARG ARCH 50 ENV KUSTOMIZE_VERSION 5.0.3 51 ENV KUSTOMIZE_URL https://storage.googleapis.com/skaffold/deps/kustomize/v${KUSTOMIZE_VERSION}/kustomize_v${KUSTOMIZE_VERSION}_linux_${ARCH}.tar.gz 52 COPY deploy/skaffold/digests/kustomize.${ARCH}.sha256 . 53 RUN wget -O kustomize.tar.gz "${KUSTOMIZE_URL}" && sha256sum -c kustomize.${ARCH}.sha256 54 RUN tar -xvf kustomize.tar.gz 55 56 # Download kpt 57 FROM alpine:3.10 as download-kpt 58 ARG ARCH 59 ENV KPT_VERSION 1.0.0-beta.33 60 ENV KPT_URL https://storage.googleapis.com/skaffold/deps/kpt/v${KPT_VERSION}/kpt_linux_amd64 61 COPY deploy/skaffold/digests/kpt.${ARCH}.sha256 . 62 RUN wget -O kpt "${KPT_URL}" && sha256sum -c kpt.${ARCH}.sha256 63 RUN chmod +x kpt 64 65 # Download gcloud 66 FROM alpine:3.10 as download-gcloud 67 ARG ARCH 68 ENV GCLOUD_VERSION 432.0.0 69 ENV GCLOUD_URL https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-${GCLOUD_VERSION}-linux-GCLOUDARCH.tar.gz 70 # SHAs listed at https://cloud.google.com/sdk/docs/downloads-versioned-archives 71 COPY deploy/skaffold/digests/gcloud.${ARCH}.sha256 . 72 RUN \ 73 GCLOUDARCH=$(case "${ARCH}" in amd64) echo x86_64;; *) echo ${ARCH};; esac); \ 74 wget -O gcloud.tar.gz $(echo "${GCLOUD_URL}" | sed "s/GCLOUDARCH/${GCLOUDARCH}/g") && \ 75 sha256sum -c gcloud.${ARCH}.sha256 76 RUN tar -zxf gcloud.tar.gz 77 78 79 FROM ubuntu:20.04 as runtime_deps 80 81 RUN apt-get update && \ 82 apt-get install --no-install-recommends --no-install-suggests -y \ 83 git python unzip && \ 84 rm -rf /var/lib/apt/lists/* 85 86 COPY --from=download-skaffold skaffold /usr/local/bin/ 87 COPY --from=download-kubectl kubectl /usr/local/bin/ 88 COPY --from=download-helm helm /usr/local/bin/ 89 COPY --from=download-kustomize kustomize /usr/local/bin/ 90 COPY --from=download-kpt kpt /usr/local/bin/ 91 COPY --from=download-gcloud google-cloud-sdk/ /google-cloud-sdk/ 92 93 # Finish installation of gcloud 94 RUN /google-cloud-sdk/install.sh \ 95 --usage-reporting=false \ 96 --bash-completion=false \ 97 --disable-installation-options 98 ENV PATH=$PATH:/google-cloud-sdk/bin 99 RUN gcloud auth configure-docker && gcloud components install --quiet \ 100 gke-gcloud-auth-plugin \ 101 alpha \ 102 beta \ 103 cloud-run-proxy \ 104 log-streaming 105 106 FROM runtime_deps 107 ENV DEBIAN_FRONTEND=noninteractive 108 RUN apt-get update && apt-get install --no-install-recommends --no-install-suggests -y \ 109 curl \ 110 build-essential \ 111 python-setuptools \ 112 lsb-release \ 113 openjdk-17-jdk \ 114 software-properties-common \ 115 jq \ 116 docker.io \ 117 apt-transport-https && \ 118 rm -rf /var/lib/apt/lists/*