github.com/containerd/nerdctl@v1.7.7/Vagrantfile.freebsd (about)

     1  # -*- mode: ruby -*-
     2  # vi: set ft=ruby :
     3  
     4  #   Copyright The containerd Authors.
     5  #
     6  #   Licensed under the Apache License, Version 2.0 (the "License");
     7  #   you may not use this file except in compliance with the License.
     8  #   You may obtain a copy of the License at
     9  
    10  #       http://www.apache.org/licenses/LICENSE-2.0
    11  
    12  #   Unless required by applicable law or agreed to in writing, software
    13  #   distributed under the License is distributed on an "AS IS" BASIS,
    14  #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    15  #   See the License for the specific language governing permissions and
    16  #   limitations under the License.
    17  
    18  # Vagrantfile for FreeBSD
    19  Vagrant.configure("2") do |config|
    20    config.vm.box = "generic/freebsd13"
    21    # workaround for https://github.com/containerd/nerdctl/issues/2596
    22    config.vm.box_version = "4.3.2"
    23  
    24    memory = 2048
    25    cpus = 1
    26    config.vm.provider :virtualbox do |v, o|
    27      v.memory = memory
    28      v.cpus = cpus
    29    end
    30    config.vm.provider :libvirt do |v|
    31      v.memory = memory
    32      v.cpus = cpus
    33    end
    34  
    35    config.vm.synced_folder ".", "/vagrant", type: "rsync"
    36  
    37    config.vm.provision "install", type: "shell", run: "once" do |sh|
    38      sh.inline = <<~SHELL
    39          #!/usr/bin/env bash
    40          set -eux -o pipefail
    41          pkg install -y go containerd runj
    42          cd /vagrant
    43          go install ./cmd/nerdctl
    44      SHELL
    45    end
    46  
    47   config.vm.provision "test-unit", type: "shell", run: "never" do |sh|
    48      sh.inline = <<~SHELL
    49          #!/usr/bin/env bash
    50          set -eux -o pipefail
    51          cd /vagrant
    52          go test -v ./pkg/...
    53      SHELL
    54    end
    55  
    56    config.vm.provision "test-integration", type: "shell", run: "never" do |sh|
    57      sh.inline = <<~SHELL
    58          #!/usr/bin/env bash
    59          set -eux -o pipefail
    60          daemon -o containerd.out containerd
    61          sleep 3
    62          /root/go/bin/nerdctl run --rm --net=none dougrabson/freebsd-minimal:13 echo "Nerdctl is up and running."
    63      SHELL
    64    end
    65  
    66  end