Skip to content

nginx-proxy container broken with newer Docker and cgroups2 #40

@mejo-

Description

@mejo-

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions