-
Notifications
You must be signed in to change notification settings - Fork 87
Description
Apparently docker-gen, which is used to dynamically generate the nginx config in nginx-proxy, doesn't work with newer Docker and cgroups2. I hit this bug after upgrading my system to Debian Bullseye (with Docker 20.10.3).
The result is that the nginx config at /etc/nginx/conf.d/default.conf
is broken, leading to error no servers inside upstream
when nginx is due to be restarted.
The bug is tracked in an upstream nginx-proxy issue (nginx-proxy/nginx-proxy#1548) and there's even two pull requests to fix it in underlying docker-gen: nginx-proxy/docker-gen#335 and nginx-proxy/docker-gen#336.
I was able to locally fix the problem by unpacking docker-gen-linux-amd64-0.7.3-29-g84b3509.tar.gz
from https://github.com/steffen-p/docker-gen/releases (compiled docker-gen
binaries with PR nginx-proxy/docker-gen#335) to docker/bin/docker-gen
and applying the following patch:
diff --git a/docker/Dockerfile.nginx b/docker/Dockerfile.nginx
index 7f8bf99..d82bdeb 100644
--- a/docker/Dockerfile.nginx
+++ b/docker/Dockerfile.nginx
@@ -1,4 +1,5 @@
FROM jwilder/nginx-proxy
+ADD bin/docker-gen /usr/local/bin/
RUN { \
echo 'server_tokens off;'; \
echo 'client_max_body_size 100m;'; \
The issue will probably be solved by 1) Docker fixing its cgroups2 implementation and/or 2) docker-gen merging one of the two linked PRs. Nevertheless I thought it would be helpful to have the issue documented here as others who use nextcloud-docker-dev
might run into it sooner or later.