File: Vagrantfile.centos7

package info (click to toggle)
runc 1.0.0~rc93%2Bds1-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, experimental, sid
  • size: 3,172 kB
  • sloc: sh: 1,679; ansic: 1,039; makefile: 139
file content (62 lines) | stat: -rw-r--r-- 1,814 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
  config.vm.box = "centos/7"
  config.vm.provider :virtualbox do |v|
    v.memory = 2048
    v.cpus = 2
  end
  config.vm.provider :libvirt do |v|
    v.memory = 2048
    v.cpus = 2
  end
  config.vm.provision "shell", inline: <<-SHELL
    set -e -u -o pipefail

    # configuration
    GO_VERSION="1.15"
    BATS_VERSION="v1.2.1"
    UMOCI_VERSION="v0.4.6"

    # install yum packages
    yum install -y -q epel-release
    (cd /etc/yum.repos.d && curl -O https://copr.fedorainfracloud.org/coprs/adrian/criu-el7/repo/epel-7/adrian-criu-el7-epel-7.repo)
    yum install -y -q gcc git iptables jq glibc-static libseccomp-devel make skopeo criu
    yum clean all

    # install Go
    curl -fsSL "https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz" | tar Cxz /usr/local

    # Install umoci
    curl -o /usr/local/bin/umoci -fsSL https://github.com/opencontainers/umoci/releases/download/${UMOCI_VERSION}/umoci.amd64
    chmod +x /usr/local/bin/umoci

    # install bats
    git clone https://github.com/bats-core/bats-core
    cd bats-core
    git checkout $BATS_VERSION
    ./install.sh /usr/local
    cd ..
    rm -rf bats-core

    # set PATH (NOTE: sudo without -i ignores this PATH)
    cat >> /etc/profile.d/sh.local <<EOF
PATH=/usr/local/go/bin:/usr/local/bin:$PATH
export PATH
EOF
    source /etc/profile.d/sh.local

    # sysctl
    echo "user.max_user_namespaces=15076" > /etc/sysctl.d/userns.conf
    sysctl --system

    # Add a user for rootless tests
    useradd -u2000 -m -d/home/rootless -s/bin/bash rootless

    # Add busybox for libcontainer/integration tests
    . /vagrant/tests/integration/multi-arch.bash \
        && mkdir /busybox \
        && curl -fsSL $(get_busybox) | tar xfJC - /busybox
  SHELL
end