Skip to content

Commit

Permalink
test-cluster: use a better vagrant box for docker
Browse files Browse the repository at this point in the history
  • Loading branch information
mohsenasm committed Oct 20, 2023
1 parent 4fb9747 commit 33f67d7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 18 deletions.
18 changes: 5 additions & 13 deletions test-cluster/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@

Vagrant.configure("2") do |config|
config.vm.define "manager1" do |node|
node.vm.box = "anzz1/boot2docker"
node.vm.box_version = "18.01.0"
node.vm.box = "gusztavvargadr/docker-community-ubuntu-server"
node.vm.network :private_network, ip: "10.0.0.10"
node.vm.hostname = "manager1"

node.vm.network "forwarded_port", guest: 8080, host: 8080

node.vm.synced_folder "..", "/vagrant_parent"
node.vm.synced_folder "./data", "/vagrant_data"
node.vm.provision "shell", path: "wait-for-docker.sh"
node.vm.provision "shell", inline: <<-SHELL
Expand All @@ -20,8 +20,7 @@ Vagrant.configure("2") do |config|
end

config.vm.define "manager2" do |node|
node.vm.box = "anzz1/boot2docker"
node.vm.box_version = "18.01.0"
node.vm.box = "gusztavvargadr/docker-community-ubuntu-server"
node.vm.network :private_network, ip: "10.0.0.11"
node.vm.hostname = "manager2"

Expand All @@ -33,8 +32,7 @@ Vagrant.configure("2") do |config|
end

config.vm.define "worker1" do |node|
node.vm.box = "anzz1/boot2docker"
node.vm.box_version = "18.01.0"
node.vm.box = "gusztavvargadr/docker-community-ubuntu-server"
node.vm.network :private_network, ip: "10.0.0.21"
node.vm.hostname = "worker1"

Expand All @@ -46,8 +44,7 @@ Vagrant.configure("2") do |config|
end

config.vm.define "worker2" do |node|
node.vm.box = "anzz1/boot2docker"
node.vm.box_version = "18.01.0"
node.vm.box = "gusztavvargadr/docker-community-ubuntu-server"
node.vm.network :private_network, ip: "10.0.0.22"
node.vm.hostname = "worker2"

Expand All @@ -57,9 +54,4 @@ Vagrant.configure("2") do |config|
docker swarm join --token $(cat /vagrant_data/swarm-worker-token) 10.0.0.10:2377
SHELL
end

# config.vm.provision "shell", run: 'always', inline: <<-SHELL
config.vm.provision "shell", inline: <<-SHELL
echo 'docker:docker' | sudo chpasswd
SHELL
end
10 changes: 5 additions & 5 deletions test-cluster/commands.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Up
vagrant up

# Run swarm-dashboard
vagrant ssh manager1 # password: docker
# Run swarm-dashboard (image from Docker Hub)
vagrant ssh manager1
docker stack deploy -c /vagrant/compose-all.yml sd

<!-- # Run swarm-dashboard (build locally)
vagrant ssh manager1 # password: docker
# Run swarm-dashboard (build locally)
vagrant ssh manager1
docker stack deploy -c /vagrant_parent/test-cluster/compose-metrics.yml sd
docker-compose -f /vagrant_parent/test-cluster/compose-dashboard.yml up --build -->
docker-compose -f /vagrant_parent/test-cluster/compose-dashboard.yml up --build

# Shutdown
vagrant halt
Expand Down

0 comments on commit 33f67d7

Please sign in to comment.