I have created a minimal reproducer: https://gist.github.com/yoctozepto/e6fdc2789297fdfdff4fd45fe64c9cb9
And found that the issue was already observed, albeit for a different reason: https://github.com/moby/moby/issues/35323
It seems docker treats cases (2) and (4) differently and for some reason preserves the "shared" submounts and then forcibly mounts again on container start which causes the exponential growth effect.
I have created a minimal reproducer: https:/ /gist.github. com/yoctozepto/ e6fdc2789297fdf dff4fd45fe64c9c b9
And found that the issue was already observed, albeit for a different reason: https:/ /github. com/moby/ moby/issues/ 35323
It seems docker treats cases (2) and (4) differently and for some reason preserves the "shared" submounts and then forcibly mounts again on container start which causes the exponential growth effect.