Skip to content

Instantly share code, notes, and snippets.

View sebbbastien's full-sized avatar

Sébastien sebbbastien

  • Newlode
  • Paris
  • 10:05 (UTC +02:00)
View GitHub Profile
@sebbbastien
sebbbastien / README.md
Created August 9, 2021 07:45 — forked from yorickdowne/README.md
UFW and docker iptables via DOCKER-USER

Use ufw for some, but not all, Docker traffic

This is a slight tweak to https://github.com/chaifeng/ufw-docker by way of https://p1ngouin.com/posts/how-to-manage-iptables-rules-with-ufw-and-docker

For an automated way of handling ufw rules via docker-compose, see https://github.com/shinebayar-g/ufw-docker-automated

Use case

I wanted Docker to keep managing its own iptables rules, including automatically opening port forwards, with the option of stepping in and restricting a port that I did not want open to "world". Container-to-container traffic should flow unimpeded,

#TMSH-VERSION: 12.1.1
cli admin-partitions {
update-partition Common
}
sys application template /Common/_test {
actions {
definition {
html-help {
}
####################################
# LIQUID PROMPT CONFIGURATION FILE #
####################################
# If you want to use different themes and features,
# you can load the corresponding files here:
#source ~/code/liquidprompt/nojhan.theme
#LP_PS1_FILE="~/code/liquidprompt/nojhan.ps1"
#############