pass ufw_docker_agent_image

This commit is contained in:
Chai Feng 2018-10-03 12:03:34 +08:00
parent 8eb83755b9
commit a53fe1ba25
No known key found for this signature in database
GPG Key ID: 2DCD9A24E523FFD2
2 changed files with 3 additions and 0 deletions

View File

@ -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"

View File

@ -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}"