k8s.io/test-infra@v0.0.0-20240520184403-27c6b4c223d8/images/bazelbuild/Dockerfile (about) 1 # Copyright 2016 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 # Includes git, gcloud, and bazel. 16 ARG OLD_BAZEL_VERSION 17 FROM launcher.gcr.io/google/bazel:${OLD_BAZEL_VERSION} as old 18 FROM ubuntu:18.04 19 20 # add env we can debug with the image name:tag 21 ARG IMAGE_ARG 22 ENV IMAGE=${IMAGE_ARG} 23 24 ARG BAZEL_VERSION 25 26 RUN apt-get update && apt-get install -y --no-install-recommends \ 27 build-essential \ 28 ca-certificates \ 29 file \ 30 git \ 31 openssh-client \ 32 python2.7 \ 33 python3 \ 34 python-pip \ 35 python3-pip \ 36 rpm \ 37 unzip \ 38 wget \ 39 zip \ 40 zlib1g-dev \ 41 && rm -rf /var/lib/apt/lists/* \ 42 && pip install --no-cache-dir setuptools wheel \ 43 && pip3 install --no-cache-dir setuptools wheel 44 45 RUN wget -q https://dl.google.com/dl/cloudsdk/channels/rapid/google-cloud-sdk.tar.gz && \ 46 tar xf google-cloud-sdk.tar.gz && \ 47 rm google-cloud-sdk.tar.gz && \ 48 ./google-cloud-sdk/install.sh 49 ENV PATH "/google-cloud-sdk/bin:${PATH}" 50 51 ENV NODE_VERSION 6.10.0 52 RUN wget -q https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.xz && \ 53 tar xf node-v${NODE_VERSION}-linux-x64.tar.xz --strip-components=1 -C /usr && \ 54 rm node-v${NODE_VERSION}-linux-x64.tar.xz && \ 55 npm install -g mocha 56 57 RUN INSTALLER="bazel-${BAZEL_VERSION}-installer-linux-x86_64.sh"; \ 58 DOWNLOAD_URL="https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/${INSTALLER}"; \ 59 wget -q "${DOWNLOAD_URL}" && \ 60 chmod +x "${INSTALLER}" && "./${INSTALLER}" && rm "${INSTALLER}" 61 62 ARG OLD_BAZEL_VERSION 63 COPY --from=old \ 64 /usr/local/lib/bazel/bin/bazel-real /usr/local/lib/bazel/bin/bazel-${OLD_BAZEL_VERSION} 65 66 67 WORKDIR /workspace 68 COPY runner /usr/local/bin/ 69 ENTRYPOINT ["/bin/bash", "/usr/local/bin/runner"]