1
2
mirror of https://github.com/vimagick/dockerfiles synced 2024-06-30 02:31:31 +00:00
dockerfiles/iptables/Dockerfile

22 lines
556 B
Docker
Raw Normal View History

2015-09-26 15:46:38 +00:00
#
# Dockerfile for iptables
#
FROM alpine
MAINTAINER kev <noreply@datageek.info>
RUN apk add -U iproute2
ENV TCP_PORTS 80,443
ENV UDP_PORTS 53
ENV RATE 1mbit
2015-09-27 02:38:41 +00:00
ENV BURST 1kb
2015-09-26 15:46:38 +00:00
ENV LATENCY 50ms
ENV INTERVAL 60
CMD iptables -F \
&& iptables -A OUTPUT -p tcp -m state --state NEW -m multiport ! --dports $TCP_PORTS -j DROP \
&& iptables -A OUTPUT -p udp -m state --state NEW -m multiport ! --dports $UDP_PORTS -j DROP \
&& tc qdisc add dev eth0 root tbf rate $RATE burst $BURST latency $LATENCY \
&& watch -n $INTERVAL tc -s qdisc ls dev eth0