agones.dev/agones@v1.53.0/build/build-image/Dockerfile (about)

     1  # Copyright 2017 Google LLC 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  # ForceUpdate 12 -- change here if you need to force a rebuild
    16  
    17  FROM debian:bookworm
    18  
    19  RUN apt-get update && \
    20      apt-get install -y build-essential gnupg curl git wget psmisc rsync make python3 bash-completion \
    21      zip nano jq graphviz gettext-base plantuml software-properties-common ruby-full && \
    22      apt-get clean
    23  
    24  RUN gem install fpm && \
    25      fpm -s empty -t deb -p python2.7-0.0.0-0-any.deb --name python2.7 --license MIT --version 0.0.0 --architecture all --description 'Dummy package to satisfy google-cloud-cli dependencies.' --maintainer 'Yourself' && \
    26      dpkg -i python2.7-0.0.0-0-any.deb && \
    27      rm python2.7-0.0.0-0-any.deb
    28  
    29  # install go
    30  WORKDIR /usr/local
    31  ENV GO_VERSION=1.24.6
    32  ENV GOPATH /go
    33  ENV GO111MODULE=on
    34  RUN wget -q https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz && \
    35      tar -xzf go${GO_VERSION}.linux-amd64.tar.gz && rm go${GO_VERSION}.linux-amd64.tar.gz && mkdir ${GOPATH}
    36  
    37  # install gcloud + kubectl, because it's an easy way to test/dev against kubernetes.
    38  WORKDIR /opt
    39  
    40  # credits https://cloud.google.com/sdk/docs/install#deb
    41  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 https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key --keyring /usr/share/keyrings/cloud.google.gpg  add - && apt-get update -y && \
    42      apt-get install google-cloud-cli google-cloud-cli-gke-gcloud-auth-plugin google-cloud-cli-app-engine-go -y && \
    43      echo "source /usr/share/google-cloud-sdk/completion.bash.inc" >> /root/.bashrc
    44  
    45  # update the path for go
    46  ENV PATH /usr/local/go/bin:/go/bin:$PATH
    47  
    48  # install go tooling for development, building and testing
    49  RUN go install golang.org/x/tools/cmd/goimports@latest && \
    50      go install golang.org/x/pkgsite/cmd/pkgsite@latest
    51  
    52  # the kubernetes version for the file
    53  ENV KUBERNETES_VER 1.32.5
    54  
    55  # overwrite kubectl as we want a specific version
    56  RUN curl -LO https://dl.k8s.io/release/v${KUBERNETES_VER}/bin/linux/amd64/kubectl && \
    57      chmod go+rx ./kubectl && \
    58      mv ./kubectl /usr/local/bin/kubectl
    59  RUN echo "source <(kubectl completion bash)" >> /root/.bashrc
    60  
    61  # install the release branch of the code generator tools
    62  RUN mkdir -p /go/src/k8s.io && cd /go/src/k8s.io && \
    63   git clone -b kubernetes-${KUBERNETES_VER} --depth=3 https://github.com/kubernetes/code-generator.git
    64  
    65  # install Helm package manager
    66  ENV HELM_VER 3.18.4
    67  ENV HELM_URL https://get.helm.sh/helm-v${HELM_VER}-linux-amd64.tar.gz
    68  RUN curl -L  ${HELM_URL} > /tmp/helm.tar.gz \
    69      && tar -zxvf /tmp/helm.tar.gz -C /tmp \
    70      && mv /tmp/linux-amd64/helm /usr/local/bin/helm \
    71      && chmod go+rx /usr/local/bin/helm \
    72      && rm /tmp/helm.tar.gz && rm -rf /tmp/linux-amd64
    73  RUN echo "source <(helm completion bash)" >> /root/.bashrc
    74  
    75  # install golang-ci linter
    76  RUN go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.64.8
    77  
    78  # Install yamllint
    79  RUN apt-get update && \
    80      apt-get install -y yamllint
    81  
    82  # install gotestsum test runner
    83  RUN go install gotest.tools/gotestsum@latest
    84  
    85  # install extism
    86  RUN curl -s https://get.extism.org/cli | sh -s -- -v v1.6.2 -y && \
    87      extism lib install
    88  
    89  
    90  #
    91  #  \ \      / /__| |__  ___(_) |_ ___
    92  #   \ \ /\ / / _ \ '_ \/ __| | __/ _ \
    93  #    \ V  V /  __/ |_) \__ \ | |_  __/
    94  #     \_/\_/ \___|_.__/|___/_|\__\___|
    95  #
    96  
    97  ENV HUGO_VER 0.147.0
    98  RUN mkdir /tmp/hugo && \
    99      wget -q -O /tmp/hugo/hugo.tar.gz https://github.com/gohugoio/hugo/releases/download/v${HUGO_VER}/hugo_extended_${HUGO_VER}_Linux-64bit.tar.gz && \
   100      tar -zxvf /tmp/hugo/hugo.tar.gz -C /tmp/hugo/ && \
   101      mv /tmp/hugo/hugo /usr/local/bin/ && \
   102      rm -r /tmp/hugo
   103  
   104  # Import the Nodesource GPG key
   105  RUN apt-get update && \
   106      apt-get install -y ca-certificates curl gnupg && \
   107      mkdir -p /etc/apt/keyrings && \
   108      curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
   109  
   110  # Create deb repository for a specific Node major version
   111  ARG NODE_MAJOR=20
   112  RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" > /etc/apt/sources.list.d/nodesource.list
   113  
   114  # Update and install Node.js
   115  RUN apt-get update && apt-get install -y nodejs
   116  
   117  # install API reference docs generator
   118  RUN mkdir -p /go/src/github.com/ahmetb && \
   119      cd /go/src/github.com/ahmetb && git clone -b v0.3.0 https://github.com/ahmetb/gen-crd-api-reference-docs && \
   120      cd ./gen-crd-api-reference-docs && go build
   121  
   122  # html checker
   123  RUN mkdir /tmp/htmltest && \
   124      wget -O /tmp/htmltest/htmltest.tar.gz https://github.com/wjdp/htmltest/releases/download/v0.17.0/htmltest_0.17.0_linux_amd64.tar.gz && \
   125      tar -zxvf /tmp/htmltest/htmltest.tar.gz -C /tmp/htmltest && \
   126      mv /tmp/htmltest/htmltest /usr/local/bin && \
   127      rm -r /tmp/htmltest
   128  
   129  # make sure we keep the path to go
   130  RUN echo "export PATH=/usr/local/go/bin:/go/bin/:\$PATH" >> /root/.bashrc
   131  # make nano the editor
   132  RUN echo "export EDITOR=nano" >> /root/.bashrc
   133  
   134  # install terraform
   135  RUN wget -nv -O terraform.zip https://releases.hashicorp.com/terraform/1.5.4/terraform_1.5.4_linux_amd64.zip && unzip ./terraform.zip && mv terraform /usr/local/bin/
   136  
   137  # code generation scripts
   138  COPY *.sh /root/
   139  RUN chmod +x /root/*.sh
   140  
   141  WORKDIR /go