golang.org/x/build@v0.0.0-20240506185731-218518f32b70/env/linux-x86-vmx/prep-vm.sh (about)

     1  #!/bin/false
     2  # Copyright 2019 The Go Authors. All rights reserved.
     3  # Use of this source code is governed by a BSD-style
     4  # license that can be found in the LICENSE file.
     5  
     6  # This runs on the Debian Stretch template VM to turn it into the
     7  # buildlet image we want. This isn't for running on the developer's
     8  # host machine.
     9  
    10  set -e
    11  set -x
    12  
    13  apt-get update
    14  apt-get install --yes apt-transport-https ca-certificates curl gnupg2 software-properties-common
    15  curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -
    16  add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
    17  apt-get update
    18  apt-get install --yes docker-ce docker-ce-cli containerd.io
    19  
    20  git clone https://github.com/GoogleCloudPlatform/konlet.git
    21  mkdir -p /usr/share/google
    22  install konlet/scripts/get_metadata_value /usr/share/google
    23  mkdir -p /usr/share/gce-containers
    24  install konlet/scripts/konlet-startup /usr/share/gce-containers/konlet-startup
    25  install konlet/scripts/konlet-startup.service /etc/systemd/system
    26  chmod -x /etc/systemd/system/konlet-startup.service
    27  systemctl enable /etc/systemd/system/konlet-startup.service
    28  systemctl start konlet-startup
    29  
    30  # Pre-pull some common images/layers to speed up future boots:
    31  gcloud auth configure-docker --quiet
    32  docker pull gcr.io/symbolic-datum-552/linux-x86-bullseye:latest
    33  docker pull gcr.io/gce-containers/konlet:v.0.9-latest
    34  
    35  apt-get dist-upgrade --yes