github.com/GoogleContainerTools/skaffold@v1.39.18/deploy/skaffold/Dockerfile.deps (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 17 # Download kubectl 18 FROM alpine:3.10 as download-kubectl 19 ARG ARCH 20 # Track default version installed by Google Cloud SDK: 409.0.0 moved to 1.22(.14) 21 # https://cloud.google.com/sdk/docs/release-notes 22 ENV KUBECTL_VERSION v1.27.2 23 ENV KUBECTL_URL https://storage.googleapis.com/kubernetes-release/release/${KUBECTL_VERSION}/bin/linux/${ARCH}/kubectl 24 # SHAs at gs://kubernetes-release/release/${KUBECTL_VERSION}/bin/linux/${ARCH}/ 25 COPY deploy/skaffold/digests/kubectl.${ARCH}.sha512 . 26 RUN wget -O kubectl "${KUBECTL_URL}" && sha512sum -c kubectl.${ARCH}.sha512 27 RUN chmod +x kubectl 28 29 # Download helm (see https://github.com/helm/helm/releases/latest) 30 FROM alpine:3.10 as download-helm 31 ARG ARCH 32 RUN echo arch=$ARCH 33 ENV HELM_VERSION v3.12.0 34 ENV HELM_URL https://get.helm.sh/helm-${HELM_VERSION}-linux-${ARCH}.tar.gz 35 COPY deploy/skaffold/digests/helm.${ARCH}.sha256 . 36 RUN wget -O helm.tar.gz "${HELM_URL}" && sha256sum -c helm.${ARCH}.sha256 37 RUN tar -xvf helm.tar.gz --strip-components 1 38 39 # Download kustomize 40 FROM alpine:3.10 as download-kustomize 41 ARG ARCH 42 ENV KUSTOMIZE_VERSION 5.0.3 43 ENV KUSTOMIZE_URL https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v${KUSTOMIZE_VERSION}/kustomize_v${KUSTOMIZE_VERSION}_linux_${ARCH}.tar.gz 44 COPY deploy/skaffold/digests/kustomize.${ARCH}.sha256 . 45 RUN wget -O kustomize.tar.gz "${KUSTOMIZE_URL}" && sha256sum -c kustomize.${ARCH}.sha256 46 RUN tar -xvf kustomize.tar.gz 47 48 # Download kpt 49 FROM alpine:3.10 as download-kpt 50 ARG ARCH 51 ENV KPT_VERSION 1.0.0-beta.33 52 ENV KPT_URL https://storage.googleapis.com/skaffold/deps/kpt/v${KPT_VERSION}/kpt_linux_amd64 53 COPY deploy/skaffold/digests/kpt.${ARCH}.sha256 . 54 RUN wget -O kpt "${KPT_URL}" && sha256sum -c kpt.${ARCH}.sha256 55 RUN chmod +x kpt 56 57 # Download kompose 58 FROM alpine:3.10 as download-kompose 59 ARG ARCH 60 ENV KOMPOSE_VERSION v1.26.0 61 ENV KOMPOSE_URL https://github.com/kubernetes/kompose/releases/download/${KOMPOSE_VERSION}/kompose-linux-amd64 62 COPY deploy/skaffold/digests/kompose.${ARCH}.sha256 . 63 RUN wget -O kompose "${KOMPOSE_URL}" && sha256sum -c kompose.${ARCH}.sha256 64 RUN chmod +x kompose 65 66 # Download container-structure-test (https://github.com/GoogleContainerTools/container-structure-test/releases/latest) 67 FROM alpine:3.10 as download-container-structure-test 68 ARG ARCH 69 ENV CONTAINER_STRUCTURE_TEST_VERSION v1.10.0 70 ENV CONTAINER_STRUCTURE_TEST_URL https://storage.googleapis.com/container-structure-test/${CONTAINER_STRUCTURE_TEST_VERSION}/container-structure-test-linux-${ARCH} 71 COPY deploy/skaffold/digests/container-structure-test.${ARCH}.sha512 . 72 RUN wget -O container-structure-test "${CONTAINER_STRUCTURE_TEST_URL}" && sha512sum -c container-structure-test.${ARCH}.sha512 73 RUN chmod +x container-structure-test 74 75 # Download kind 76 FROM alpine:3.10 as download-kind 77 ARG ARCH 78 ENV KIND_VERSION v0.11.1 79 ENV KIND_URL https://github.com/kubernetes-sigs/kind/releases/download/${KIND_VERSION}/kind-linux-${ARCH} 80 COPY deploy/skaffold/digests/kind.${ARCH}.sha512 . 81 RUN wget -O kind "${KIND_URL}" && sha512sum -c kind.${ARCH}.sha512 82 RUN chmod +x kind 83 84 # Download k3d 85 FROM alpine:3.10 as download-k3d 86 ARG ARCH 87 ENV K3D_VERSION v5.0.3 88 ENV K3D_URL https://github.com/rancher/k3d/releases/download/${K3D_VERSION}/k3d-linux-amd64 89 COPY deploy/skaffold/digests/k3d.${ARCH}.sha256 . 90 RUN wget -O k3d "${K3D_URL}" && sha256sum -c k3d.${ARCH}.sha256 91 RUN chmod +x k3d 92 93 # Download gcloud 94 FROM alpine:3.10 as download-gcloud 95 ARG ARCH 96 ENV GCLOUD_VERSION 432.0.0 97 ENV GCLOUD_URL https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-${GCLOUD_VERSION}-linux-GCLOUDARCH.tar.gz 98 # SHAs listed at https://cloud.google.com/sdk/docs/downloads-versioned-archives 99 COPY deploy/skaffold/digests/gcloud.${ARCH}.sha256 . 100 RUN \ 101 GCLOUDARCH=$(case "${ARCH}" in amd64) echo x86_64;; *) echo ${ARCH};; esac); \ 102 wget -O gcloud.tar.gz $(echo "${GCLOUD_URL}" | sed "s/GCLOUDARCH/${GCLOUDARCH}/g") && \ 103 sha256sum -c gcloud.${ARCH}.sha256 104 RUN tar -zxf gcloud.tar.gz 105 106 # Download bazel 107 FROM alpine:3.10 as download-bazel 108 ARG ARCH 109 ENV BAZEL_VERSION 4.2.1 110 ENV BAZEL_URL https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-linux-BAZELARCH 111 COPY deploy/skaffold/digests/bazel.${ARCH}.sha256 . 112 RUN \ 113 BAZELARCH=$(case "${ARCH}" in amd64) echo x86_64;; *) echo ${ARCH};; esac); \ 114 wget -O bazel $(echo "${BAZEL_URL}" | sed "s/BAZELARCH/${BAZELARCH}/g") && \ 115 sha256sum -c bazel.${ARCH}.sha256 116 RUN chmod +x bazel 117 118 FROM ubuntu:20.04 as runtime_deps 119 120 RUN apt-get update && \ 121 apt-get install --no-install-recommends --no-install-suggests -y \ 122 git python3 unzip && \ 123 rm -rf /var/lib/apt/lists/* 124 125 COPY --from=docker:19.03.13 /usr/local/bin/docker /usr/local/bin/ 126 COPY --from=download-kubectl kubectl /usr/local/bin/ 127 COPY --from=download-helm helm /usr/local/bin/ 128 COPY --from=download-kustomize kustomize /usr/local/bin/ 129 COPY --from=download-kpt kpt /usr/local/bin/ 130 COPY --from=download-kompose kompose /usr/local/bin/ 131 COPY --from=download-container-structure-test container-structure-test /usr/local/bin/ 132 COPY --from=download-bazel bazel /usr/local/bin/ 133 COPY --from=download-gcloud google-cloud-sdk/ /google-cloud-sdk/ 134 COPY --from=download-kind kind /usr/local/bin/ 135 COPY --from=download-k3d k3d /usr/local/bin/ 136 137 # Finish installation of bazel 138 RUN bazel version 139 140 # Finish installation of gcloud 141 RUN /google-cloud-sdk/install.sh \ 142 --usage-reporting=false \ 143 --bash-completion=false \ 144 --disable-installation-options 145 ENV PATH=$PATH:/google-cloud-sdk/bin 146 RUN gcloud auth configure-docker && \ 147 gcloud components install gke-gcloud-auth-plugin 148 149 FROM runtime_deps 150 ENV DEBIAN_FRONTEND=noninteractive 151 RUN apt-get update && apt-get install --no-install-recommends --no-install-suggests -y \ 152 build-essential \ 153 python-setuptools \ 154 lsb-release \ 155 openjdk-11-jdk \ 156 software-properties-common \ 157 jq \ 158 apt-transport-https && \ 159 rm -rf /var/lib/apt/lists/* 160 COPY --from=golang:1.21.0 /usr/local/go /usr/local/go 161 ENV PATH /usr/local/go/bin:/root/go/bin:$PATH