-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathVagrantfile
65 lines (56 loc) · 1.88 KB
/
Vagrantfile
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
63
64
65
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/focal64"
config.vm.box_check_update = false
config.vm.provider "virtualbox" do |vb|
# # Display the VirtualBox GUI when booting the machine
# vb.gui = true
#
# # Customize the amount of memory on the VM:
vb.memory = "8192"
end
#
## Instalar DOCKER
config.vm.provision "shell", inline: <<-SHELL
apt-get update
apt-get -y install \
ca-certificates \
curl \
gnupg \
figlet \
lsb-release
#
mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
#
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
#
apt-get update
apt-get -y install docker-ce docker-ce-cli containerd.io docker-compose-plugin figlet
usermod -a -G docker vagrant
SHELL
## Configuracion del docker daemon
config.vm.provision "shell", inline: <<-SHELL
echo ***** CONFIGURACION DEL DOCKER DAEMON
sudo cp /vagrant/daemon.json /etc/docker/
sudo systemctl restart docker
SHELL
## Instalar ContainerLab
config.vm.provision "shell", inline: <<-SHELL
echo ***** INSTALAR CONTAINER LAB
apt-get update
bash -c "$(curl -sL https://get.containerlab.dev)"
SHELL
# FINAL
config.vm.provision "shell", inline: <<-SHELL
docker ps -a
figlet 'Containerlab Ready!'
SHELL
end