Learn how one can use nftables for implementing firewall rules, whilst using Docker. However, this will require Docker to run in host networking mode.
A cheatsheet for using nftables.