k8s.io/test-infra@v0.0.0-20240520184403-27c6b4c223d8/images/gcb-docker-gcloud/Dockerfile (about) 1 # Copyright 2018 The Kubernetes Authors. 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 GO_VERSION 16 17 FROM multiarch/qemu-user-static:7.2.0-1 as qemu-image 18 19 # Includes bash, docker, and gcloud 20 FROM golang:${GO_VERSION}-alpine 21 22 # add env we can debug with the image name:tag 23 ARG IMAGE_ARG 24 ENV IMAGE=${IMAGE_ARG} 25 26 # Install gcloud, docker, and bash 27 ENV PATH=/google-cloud-sdk/bin:/workspace:${PATH} \ 28 CLOUDSDK_CORE_DISABLE_PROMPTS=1 29 30 WORKDIR /workspace 31 32 RUN echo http://dl-cdn.alpinelinux.org/alpine/latest-stable/community >> /etc/apk/repositories && \ 33 apk --no-cache add curl python3 py-crcmod bash libc6-compat openssh-client git gnupg docker-cli make 34 35 RUN curl -fsSLO https://dl.google.com/dl/cloudsdk/channels/rapid/google-cloud-sdk.tar.gz 36 RUN tar xzf google-cloud-sdk.tar.gz -C / 37 RUN rm google-cloud-sdk.tar.gz 38 RUN gcloud config set core/disable_usage_reporting true && \ 39 gcloud config set component_manager/disable_update_check true && \ 40 gcloud config set metrics/environment github_docker_image && \ 41 gcloud components install alpha beta gke-gcloud-auth-plugin gsutil && \ 42 gcloud --version && \ 43 gcloud info > /workspace/gcloud-info.txt 44 45 # Default home for cloudbuild jobs is /builder/home 46 RUN mkdir -p /builder/home 47 48 # Copy qemu static binaries. 49 COPY --from=qemu-image /usr/bin /qemu-bin 50 RUN cp /qemu-bin/qemu-* /usr/bin/ && \ 51 rm -rf /qemu-bin 52 COPY --from=qemu-image /qemu-binfmt-conf.sh /qemu-binfmt-conf.sh 53 COPY --from=qemu-image /register /register 54 ADD ./buildx-entrypoint.sh /buildx-entrypoint 55 56 RUN apk add qemu 57 58 # Install buildx system-wide for fast docker builds 59 COPY --from=docker/buildx-bin:0.12.1 /buildx /usr/libexec/docker/cli-plugins/docker-buildx 60 61 ENTRYPOINT ["/bin/bash"]