From a53fe1ba257e367f269df023102209f644d6f83c Mon Sep 17 00:00:00 2001 From: Chai Feng Date: Wed, 3 Oct 2018 12:03:34 +0800 Subject: [PATCH] pass ufw_docker_agent_image --- docker-entrypoint.sh | 1 + ufw-docker | 2 ++ 2 files changed, 3 insertions(+) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index b10a939..90e2151 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -3,6 +3,7 @@ [[ 0 -eq "$#" ]] && set -- start ufw_docker_agent=ufw-docker-agent +ufw_docker_agent_image="${ufw_docker_agent_image:-chaifeng/${ufw_docker_agent}:181003}" function ufw-update-service-instances() { name="$1" diff --git a/ufw-docker b/ufw-docker index dcfcb17..9276654 100755 --- a/ufw-docker +++ b/ufw-docker @@ -152,10 +152,12 @@ function ufw-docker--service-allow() { docker service create --name "$ufw_docker_agent" --mode global \ --mount type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock \ --mount type=bind,source=/etc/ufw,target=/etc/ufw,readonly=true \ + --env ufw_docker_agent_image="${ufw_docker_agent_image}" \ --env "${service_env}" \ "${ufw_docker_agent_image}" else docker service update --update-parallelism=0 \ + --env-add ufw_docker_agent_image="${ufw_docker_agent_image}" \ --env-add "${service_env}" \ --image "${ufw_docker_agent_image}" \ "${ufw_docker_agent}"