bundlewrap/bundles/docker-ce/metadata.py

42 lines
929 B
Python
Raw Normal View History

2022-12-24 16:40:13 +00:00
defaults = {
'apt': {
'repos': {
'docker': {
'items': {
'deb https://download.docker.com/linux/debian {os_release} stable',
},
},
},
'packages': {
'docker-ce': {},
'docker-ce-cli': {},
},
},
2022-12-24 17:22:29 +00:00
'nftables': {
'rules': {
'00-docker-ce': {
'inet filter forward ct state { related, established } accept',
'inet filter forward iifname docker0 accept',
},
},
},
2022-12-24 16:40:13 +00:00
}
2022-12-24 17:22:29 +00:00
@metadata_reactor.provides(
'nftables/rules/00-docker-ce',
)
def nftables_nat(metadata):
rules = set()
for iface in metadata.get('interfaces'):
rules.add(f'nat postrouting oifname {iface} masquerade')
return {
'nftables': {
'rules': {
'00-docker-ce': rules,
},
},
}