You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use the 3 container setup (~18 months now) as the entrypoint to a collection of web services hosted in a single node Docker Swarm environment. I use helderco/docker-gen in place of nginx-proxy/docker-gen to support the dynamic container names used in Swarm mode.
The Problem
The 3 container setup works without issue when only one Nginx replica is used. Upon scaling up to two or more replicas, acme-companion begins generating these logs: Note: This is an example using 2 replicas, and the printed container id is 128 characters.
It appears that the above error is generated in check_nginx_proxy_container_run in functions.sh. After doing some digging, I think I've isolated the problem to the following:
All Nginx replicas use the same container label com.example.nginx_proxy
On any call to get_nginx_proxy_container in functions.sh the function returns a single id string of length 64 * n_replicas
Docker full container IDs are 64 characters
Both check_nginx_proxy_container_run and reload_nginx in functions.sh use the container id returned from get_nginx_proxy_container but do not account for the possibility that the string contains multiple ids.
The Fix?
I am not intimately familiar with the codebase, but it appears that check_nginx_proxy_container_run and reload_nginx simply need to parse the concatenated string and loop over each id while performing the state check or calling docker_kill.
Context
I use the 3 container setup (~18 months now) as the entrypoint to a collection of web services hosted in a single node Docker Swarm environment. I use helderco/docker-gen in place of nginx-proxy/docker-gen to support the dynamic container names used in Swarm mode.
The Problem
The 3 container setup works without issue when only one Nginx replica is used. Upon scaling up to two or more replicas, acme-companion begins generating these logs:
Note: This is an example using 2 replicas, and the printed container id is 128 characters.
It appears that the above error is generated in
check_nginx_proxy_container_run
infunctions.sh
. After doing some digging, I think I've isolated the problem to the following:com.example.nginx_proxy
get_nginx_proxy_container
infunctions.sh
the function returns a single id string of length 64 * n_replicascheck_nginx_proxy_container_run
andreload_nginx
infunctions.sh
use the container id returned fromget_nginx_proxy_container
but do not account for the possibility that the string contains multiple ids.The Fix?
I am not intimately familiar with the codebase, but it appears that
check_nginx_proxy_container_run
andreload_nginx
simply need to parse the concatenated string and loop over each id while performing the state check or calling docker_kill.EDIT: added Stack YAML
The text was updated successfully, but these errors were encountered: