github.com/GoogleContainerTools/kaniko@v1.23.0/Vagrantfile (about)

     1  # -*- mode: ruby -*-
     2  # vi: set ft=ruby :
     3  
     4  Vagrant.configure("2") do |config|
     5    config.vm.box = "generic/debian10"
     6    config.vm.synced_folder ".", "/go/src/github.com/GoogleContainerTools/kaniko"
     7    config.ssh.extra_args = ["-t", "cd /go/src/github.com/GoogleContainerTools/kaniko; bash --login"]
     8  
     9    config.vm.provision "shell", inline: <<-SHELL
    10      apt-get update && apt-get install -y \
    11        apt-transport-https \
    12        ca-certificates \
    13        curl \
    14        gnupg-agent \
    15        html-xml-utils \
    16        python \
    17        wget \
    18        ca-certificates \
    19        jq \
    20        software-properties-common
    21      curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -
    22      add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
    23      apt-get update
    24      apt-get install -y docker-ce-cli docker-ce containerd.io
    25      usermod -a -G docker vagrant
    26  
    27      curl -LO https://storage.googleapis.com/container-diff/latest/container-diff-linux-amd64
    28      chmod +x container-diff-linux-amd64 && mv container-diff-linux-amd64 /usr/local/bin/container-diff
    29  
    30      wget --quiet https://storage.googleapis.com/pub/gsutil.tar.gz
    31      mkdir -p /opt/gsutil
    32      tar xfz gsutil.tar.gz -C /opt/
    33      rm gsutil.tar.gz
    34      ln -s /opt/gsutil/gsutil /usr/local/bin
    35  
    36      export GODLURL=https://go.dev/dl/$(curl --silent --show-error https://go.dev/dl/ | hxnormalize -x | hxselect -s "\n" "span, #filename" | grep linux | cut -d '>' -f 2 | cut -d '<' -f 1)
    37      echo "Downloading go from: $GODLURL"
    38      wget --quiet $GODLURL
    39      tar -C /usr/local -xzf go*.linux-amd64.tar.gz
    40      echo 'export PATH=$PATH:/usr/local/go/bin:/go/bin' > /etc/profile.d/go-path.sh
    41      echo 'export GOPATH=/go' >> /etc/profile.d/go-path.sh
    42      chmod a+x /etc/profile.d/go-path.sh
    43      chown vagrant /go
    44      chown vagrant /go/bin
    45  
    46      docker run --rm  -d -p 5000:5000 --name registry -e DEBUG=true registry:2
    47      echo 'export IMAGE_REPO=localhost:5000' > /etc/profile.d/local-registry.sh
    48      chmod a+x /etc/profile.d/local-registry.sh
    49      export PATH=$PATH:/usr/local/go/bin:/go/bin
    50      export GOPATH=/go
    51      go get github.com/google/go-containerregistry/cmd/crane
    52    SHELL
    53  end