From 0c3da26e8335eece2ef163e1b94502581c9fd278 Mon Sep 17 00:00:00 2001 From: Chai Feng Date: Sun, 2 Dec 2018 07:55:34 +0800 Subject: [PATCH] use local build image in vagrant --- Vagrantfile | 3 +++ ufw-docker | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Vagrantfile b/Vagrantfile index 3893fdb..70b62d4 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -66,6 +66,9 @@ Vagrant.configure('2') do |config| set -ex docker build -t #{ufw_docker_agent_image} /vagrant docker push #{ufw_docker_agent_image} + + echo "export UFW_DOCKER_AGENT_IMAGE=#{ufw_docker_agent_image}" > /etc/profile.d/ufw-docker.sh + echo "Defaults env_keep += UFW_DOCKER_AGENT_IMAGE" > /etc/sudoers.d/98_ufw-docker SHELL master.vm.provision "swarm-init", type: 'shell', inline: <<-SHELL diff --git a/ufw-docker b/ufw-docker index 37da673..6a2acba 100755 --- a/ufw-docker +++ b/ufw-docker @@ -11,7 +11,7 @@ GREP_REGEXP_INSTANCE_NAME="[-_.[:alnum:]]\\+" DEFAULT_PROTO=tcp ufw_docker_agent=ufw-docker-agent -ufw_docker_agent_image="${ufw_docker_agent_image:-chaifeng/${ufw_docker_agent}:181005}" +ufw_docker_agent_image="${UFW_DOCKER_AGENT_IMAGE:-chaifeng/${ufw_docker_agent}:181005}" function ufw-docker--status() { ufw-docker--list "$GREP_REGEXP_INSTANCE_NAME"