content: # Copyright 2021 Google LLC
  #
  # Licensed under the Apache License, Version 2.0 (the "License");
  # you may not use this file except in compliance with the License.
  # You may obtain a copy of the License at
  #
  #     http://www.apache.org/licenses/LICENSE-2.0
  #
  # Unless required by applicable law or agreed to in writing, software
  # distributed under the License is distributed on an "AS IS" BASIS,
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  # See the License for the specific language governing permissions and
  # limitations under the License.
  
  FROM ubuntu:24.04
  
  ENV DEBIAN_FRONTEND=noninteractive
  # bigquery/read/arrow: bison is for thrift, which is a dependency for arrow
  # bigquery/read/arrow: flex is for thrift, which is a dependency for arrow
  RUN apt update \
      && apt install -y \
          bison \
          build-essential \
          git \
          gcc \
          g++ \
          clang \
          cmake \
          curl \
          flex \
          llvm \ 
          ninja-build \
          pkg-config \
          python3 \
          tar \
          zip \
          unzip 
  
  RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | \
      tee -a /etc/apt/sources.list.d/google-cloud-sdk.list \
      && curl -sSL https://packages.cloud.google.com/apt/doc/apt-key.gpg | \
      apt-key --keyring /usr/share/keyrings/cloud.google.gpg  add - \
      && apt-get update -y \
      && apt-get install google-cloud-sdk -y
  
  WORKDIR /usr/local/vcpkg
  # Pin vcpkg to the latest released version. Renovatebot sends PRs when there is a new release.
  RUN curl -sSL "https://github.com/Microsoft/vcpkg/archive/2024.04.26.tar.gz" | \
      tar --strip-components=1 -zxf - \
      && ./bootstrap-vcpkg.sh \
      && /usr/local/vcpkg/vcpkg fetch cmake \
      && /usr/local/vcpkg/vcpkg fetch ninja
  
  ARG ARCH=amd64
  RUN curl -o /usr/bin/bazelisk -sSL "https://github.com/bazelbuild/bazelisk/releases/download/v1.15.0/bazelisk-linux-${ARCH}" && \
      chmod +x /usr/bin/bazelisk && \
      ln -s /usr/bin/bazelisk /usr/bin/bazel
  