disable userland-proxy it takes too much CPU for localhost traffic

Create a file named /etc/docker/daemon.json if it does not exist, and add the “userland-proxy”: false setting. The daemon.json file should be valid JSON; if this is the only configuration in that file, it should look like;

“userland-proxy”: false
After saving the file, restart the daemon using (if your host uses systemd);

sudo systemctl restart docker
Note: On Docker for Mac and Docker for Windows, the userland-proxy cannot be disabled, as it is an essential part of the networking (i.e. it allows connections to localhost to be forwarded to the containers)