-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
37 lines (31 loc) · 1.48 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.define "swarm_manager", primary: true do |swarm_manager|
swarm_manager.vm.box = "debian/contrib-stretch64"
swarm_manager.vm.hostname = 'swarm-manager'
swarm_manager.vm.box_check_update = false
swarm_manager.vm.synced_folder ".", "/vagrant_data"
swarm_manager.vm.network :private_network, ip: "192.168.56.101"
swarm_manager.vm.provider :virtualbox do |v|
v.customize ["modifyvm", :id, "--cpuexecutioncap", "50"]
v.customize ["modifyvm", :id, "--memory", 6144]
v.customize ["modifyvm", :id, "--name", "swarm_manager"]
end
swarm_manager.vm.provision "shell", inline: <<-SHELL
# curl
apt install -y curl
# docker
apt-get update
apt-get install -y apt-transport-https ca-certificates curl gnupg2 software-properties-common
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
apt-get update
apt-get install -y docker-ce=5:18.09.7~3-0~debian-stretch docker-ce-cli=5:18.09.7~3-0~debian-stretch containerd.io
usermod -aG docker vagrant
# docker-compose
curl -L https://github.com/docker/compose/releases/download/1.24.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
SHELL
end
end