If your MongoDB instance is hosted on a system that also runs other software, such as a webserver, you should choose the first swap strategy. Do not disable swap in this case.
Is it absolute? why? (Why should I not disable swap in this case?)
Says we have 4 GB nodes and limit cacheSizeGB to 0.5 GB (50% of (2GB - 1 GB)), isn’t it safe to use another 2GB to run containers without swap?
I do not believe it is absolute. For example, if you are confident in your systems workload & memory usage and know for certain that swapping isn’t required, then swapping could possibly be disabled in this case.
One of the reasons that swapping is enabled is to help prevent the linux OOM killer from terminating the mongod instance. Perhaps you may wish to disable it if the OS the mongod instances are running on do not have a OOM kill function.
I’m not too familiar with Docker but I hope these details help.