UFW Docker
To fix the Docker and UFW security flaw without disabling iptables
... can manually add some rules in the UFW configuration file, such as -A POSTROUTING! -o docker0 -s 172.17.0.0/16 -j MASQUERADE. But this only allows containers that belong to network 172.17.0.0/16 can access outside. If we create a new docker network, we must manually add similar iptables rules for the new network.