Ubuntu UFW and Docker security
11.05.2022
There is a security issue when running Ubuntu 16/18, Docker and UFW together. The standard Docker settings involve direct controlling of iptables. If you specify any UFW rules, they won’t be applied to docker.
Configure the UFW firewall:
–code–
Run docker using open port
–code2-
Try connecting:
Let’s solve the problem
Method 1: don’t expose ports, resort to –net=host with containers
Method 2: change the Docker response by creating or correcting the /etc/docker/daemon.json file.
–code3–
Try connecting: