-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
26 lines (26 loc) · 1.03 KB
/
docker-compose.yml
File metadata and controls
26 lines (26 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
version: '2.2'
services:
# This is a daemon that listens to docker container events, and deletes stale UDP conntrack entries linked to the BF2 master server and master listing server
# The most important deletion is on a healthcheck event (e.g. healthy), so ensure there is a healthcheck for the bf2 container
# See: https://github.com/moby/moby/issues/8795
delete-udp-conntrack:
image: docker:20.10.20
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
network_mode: host
cap_add:
- NET_ADMIN
stop_signal: SIGKILL
restart: always
entrypoint:
- /bin/sh
command:
- -c
- |
set -eu
apk add --no-cache conntrack-tools
docker events --filter type=container --filter event=create --filter event=start --filter event=health_status | while read; do
conntrack -D -p udp --orig-port-dst 27900 || true
conntrack -D -p udp --orig-port-dst 27910 || true
conntrack -D -p udp --orig-port-src 58665 || true
done