shinebayar-g / ufw-docker-automated

Manage docker containers firewall with UFW!
Apache License 2.0
198 stars 31 forks source link

Multiple container shutdown isn't handled correctly #24

Closed shinebayar-g closed 3 years ago

shinebayar-g commented 3 years ago

Docker stop command accepts multiple container name|id as an parameter. In the event of docker stop container1 container2 app tries to inspect the container after it's gone, resulting error

ufw-docker-automated: Couldn't inspect container: Error: No such container: ddbdb8b5427142a421a398ba1beff8332cfe0588842a2d27e8add5b343ba16f9

Previously this issue was tracked & fixed in https://github.com/shinebayar-g/ufw-docker-automated/issues/11. Python implementation used to find ufw status numbered, grep, awk combination to identify which rules to delete. In Go implementation I got rid of this technique and using ufw route delete command by passing exact ufw rules.

Unfortunately this approach recreated the #11