diff --git a/README.md b/README.md index 50604dd..6677780 100644 --- a/README.md +++ b/README.md @@ -95,6 +95,7 @@ A collection of delicious docker recipes. - [x] portia - [x] pure-ftpd - [x] redis-arm +- [x] rinetd - [x] rslsync - [x] rsyncd - [x] rsyslog diff --git a/rinetd/Dockerfile b/rinetd/Dockerfile new file mode 100644 index 0000000..ed06d42 --- /dev/null +++ b/rinetd/Dockerfile @@ -0,0 +1,24 @@ +# +# Dockerfile for rinetd +# + +FROM alpine +MAINTAINER kev + +ENV RINETD_VERSION 0.70 +ENV RINETD_URL https://github.com/samhocevar/rinetd/releases/download/v${RINETD_VERSION}/rinetd-${RINETD_VERSION}.tar.gz + +RUN set -xe \ + && apk add --no-cache build-base curl tar \ + && mkdir rinetd \ + && cd rinetd \ + && curl -sSL $RINETD_URL | tar xz --strip 1 \ + && ./configure --prefix=/usr --sysconfdir=/etc/rinetd \ + && make install \ + && cd .. \ + && rm -r rinetd \ + && apk del build-base curl tar + +VOLUME /etc/rinetd + +CMD ["rinetd", "-f", "-c", "/etc/rinetd/rinetd.conf"] diff --git a/rinetd/README.md b/rinetd/README.md new file mode 100644 index 0000000..797bb6f --- /dev/null +++ b/rinetd/README.md @@ -0,0 +1,8 @@ +rinetd +====== + +[rinetd][1] is used to efficiently redirect connections from one IP +address/port combination to another. It is useful when operating virtual +servers, firewalls and the like. + +[1]: https://github.com/samhocevar/rinetd diff --git a/rinetd/data/rinetd.conf b/rinetd/data/rinetd.conf new file mode 100644 index 0000000..25bdf4a --- /dev/null +++ b/rinetd/data/rinetd.conf @@ -0,0 +1,32 @@ +# +# this is the configuration file for rinetd, the internet redirection server +# +# you may specify global allow and deny rules here +# only ip addresses are matched, hostnames cannot be specified here +# the wildcards you may use are * and ? +# +# allow 192.168.2.* +# deny 192.168.2.1? + + +# +# forwarding rules come here +# +# you may specify allow and deny rules after a specific forwarding rule +# to apply to only that forwarding rule +# +# bindadress bindport connectaddress connectport options... +# 0.0.0.0 80 192.168.1.2 80 +# 127.0.0.1 4000 127.0.0.1 3000 +# 127.0.0.1 4000/udp 127.0.0.1 22 [timeout=1200] +# 127.0.0.1 8000/udp 192.168.1.2 8000/udp [src=192.168.1.2,timeout=1200] + +127.0.0.1 5353/udp 8.8.8.8 53/udp + +# logging information +# logfile /var/log/rinetd.log + +logfile /dev/stdout + +# uncomment the following line if you want web-server style logfile format +# logcommon diff --git a/rinetd/docker-compose.yml b/rinetd/docker-compose.yml new file mode 100644 index 0000000..9523e0d --- /dev/null +++ b/rinetd/docker-compose.yml @@ -0,0 +1,6 @@ +rinetd: + image: vimagick/rinetd + volumes: + - ./data:/etc/rinetd + net: host + restart: always