build ufw-docker-agent image in Vagrant

This commit is contained in:
Chai Feng 2018-12-01 22:04:21 +08:00
parent ab03a6aa64
commit 0ad2ebbd47

8
Vagrantfile vendored
View File

@ -60,6 +60,14 @@ Vagrant.configure('2') do |config|
daemonize: true daemonize: true
end end
ufw_docker_agent_image = "192.168.56.130:5000/chaifeng/ufw-docker-agent:test"
master.vm.provision "docker-build", type: 'shell', inline: <<-SHELL
set -ex
docker build -t #{ufw_docker_agent_image} /vagrant
docker push #{ufw_docker_agent_image}
SHELL
master.vm.provision "swarm-init", type: 'shell', inline: <<-SHELL master.vm.provision "swarm-init", type: 'shell', inline: <<-SHELL
set -ex set -ex
docker info | fgrep 'Swarm: active' && exit 0 docker info | fgrep 'Swarm: active' && exit 0