-
Notifications
You must be signed in to change notification settings - Fork 604
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFC] get containerID from /cat/proc/mountinfo #335
Conversation
On new distributions like Fedora Server 33 '/cat/proc/cgroup' does not contain expected container hash. In fact it remains empty: ``` $ cat /proc/self/cgroup 0::/ ``` Only guess is that recent support for cgroupv2 in Docker 20.10.0 December 9, 2020 release has some flaws. Therefore, with this change current container ID is read from '/cat/proc/mountinfo'. Signed-off-by: Steffen Pengel <steffen.pengel@gmail.com>
Please add this! It's a very important change and will affect others distros in the future. |
@steffen-p I believe that this is an lost repo, there is no update since 2018. |
@BrenoMazieiro Thanks for taking a look. Releases of this repository are used in nginx-reverse project, which is definitely active (https://github.com/nginx-proxy/nginx-proxy/blob/master/Dockerfile#L23). About the patch: It could be seen as just a workaround for a Docker/cgroup2 issue, or as an approach to retrieve container ID for both cgroup versions. Personally, I have some open questions like 'Is this information reliable in any scenarios?' but I'm no cgroup/docker expert and don't want to invest more time in this topic. |
@steffen-p
thanks christian |
I can confirm this is related to the recent updates to docker itself. I'm on a raspberry pi so I'm struggling with trying to build this for that architecture but it needs this patch either way |
I compiled and uploaded a pre-release for testing this patch more easily: https://github.com/steffen-p/docker-gen/releases/tag/0.7.3-29-g84b3509. You can modify the path as @christianuhlmann suggested, or create your own Dockerfile and use the un-tared binary:
FYI, I only tested HTH and best regards |
@steffen-p any idea? |
Not without knowing the full picture. I can give some more details on my test though:
Please check if docker-gen version running inside your container shows the expected version
If upstream is set correct by docker-gen you should be able to do:
|
hi i did the test with the same parameter and but the error is not gone. os: debian bullseye (testing)
is this problem dist specific? do you have any idea? |
There seems to get less hacky way: |
I made an alternative PR which should do the work. |
Have to weigh in here because same issue happening to me but I am on Host is Debian/Testing and uses docker Docker version Same error when passing Pulled the latest image sha256:5e6f392e99e5454851caa8a3dbb021560a32375edff772b64f862c4d7831d038 |
I plan to install @steffen-p fork on the nginx-proxy image and test with cgroup v1 and v2 but I wonder why it is based on 0.7.3 instead of 0.7.4. Any reason for that? |
Dunno.. but I was hoping the newer version was going to solve the issue but it did not. nginx-proxy image gives that docker-gen version but it fails exactly because of that. And in fact
I can see from strace it is still opening
|
🤔
and also the containers running on 19.03.10 with cgroup v1
@NicolasDorier I'm not sure about using The |
@rodrigoaguilera I based it on master rather than on 0.7.4. Reason is, all changes form 0.7.4 are contained in master branch, except 6455e0c ("Update 0.7.4") is not part of master branch. If I rebased onto tag 0.7.4 a some fixes would be left out. |
Now I understand by inspecting git history of the repo, 7.3 is hardcoded on I hope this issue gets some attention. |
I can confirm that this patch fixes nginx-proxy/nginx-proxy#1548. |
I have the same problem as @christianuhlmann.
Do you guys have any suggestions on what I can do to get my proxy back in use? |
If anyone else is also having the problem, I fixed the error I got: |
After modifying the original Creating my own Dockerfile as suggested here didn't work either, despite the fact that the right binary there. (Verified, by running
Networks are setup correctly, other containers are reachable from the ǹginx-proxy |
Fix docker-gen breaking on new docker version (See #335)
Fixed via #336 |
Hello, this is my first PR in this project. I had some problems with https://github.com/nginx-proxy/nginx-proxy on newer machines running Fedora 33 (nginx-proxy/nginx-proxy#1548) and invested some time for investigation. I just want to give it a shot and share my results.
Analysis
On new distributions like Fedora Server 33 '/cat/proc/cgroup'
does not contain expected container hash. In fact, it remains empty:
Only guess is that recent support for cgroupv2 in Docker 20.10.0
December 9, 2020 release has some flaws.
Therefore, with this change current container ID is read from
'/cat/proc/mountinfo'. I'm not sure if this information reliable though, therefore RFC.
However, it is the only place containing the current container ID. Also "/proc/1/cpuset" is empty (as proposed in [1]).
I successfully tested on Debian Stretch, running cgroup v1, that '/cat/proc/mountinfo' is working there as well.
In case I should proceed, some alignment with #324 will be needed as well.
Thanks in advance for any comments.
[1] https://github.com/buchdag/docker-gen/commit/8ca1084a608784c5d03692f20040a2984ed3922d