diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..95bf154 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM alpine:latest AS builder + +ARG XINETD_VERSION=2.3.15.4 +ARG VERSION=3.0.1 + +RUN apk add build-base autoconf automake libtool pkgconf git +RUN git clone -b ${XINETD_VERSION} https://github.com/openSUSE/xinetd.git +RUN cd xinetd && sh ./autogen.sh && ./configure && make +RUN git clone -b ${VERSION} https://github.com/gophernicus/gophernicus.git +RUN cd gophernicus && make + +FROM alpine:latest +EXPOSE 70/tcp +VOLUME /var/gopher +COPY --from=builder /xinetd/xinetd /usr/sbin +COPY --from=builder /gophernicus/gophernicus /usr/sbin +COPY xinetd.conf /etc/xinetd.conf + +CMD ["/usr/sbin/xinetd", "-dontfork"] diff --git a/README.md b/README.md index dbdf101..c82e33b 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,23 @@ # docker-gophernicus -An Alpine based Gophernicus Gopher server Docker image + +An Alpine Linux based Docker image for the Gophernicus Gopher server (https://github.com/gophernicus/gophernicus). + +Do you just want to run a simple Gopher service? Do you not want to mess the hassle of setting up old-school inetd/xinetd/systemd sockets/etc? Are you already running all your other services as containers? Well so did I! + +This image runs Gophernicus via xinetd on an Alpine Linux base for a Docker image that weighs in at just a smidge under 7MB. Set your hostname, point your favorite volume at `/var/gopher`, bind port 70 and go! + +ex: +``` +docker build -t gophernicus . + +docker run --name gophernicus \ + --hostname \ + -p 70:70 \ + -v :/var/gopher \ + gophernicus +``` + +## TODO + +- Logging to stdout +- Configuration via environment variables diff --git a/xinetd.conf b/xinetd.conf new file mode 100644 index 0000000..40fe309 --- /dev/null +++ b/xinetd.conf @@ -0,0 +1,21 @@ +defaults +{ + instances = 25 + log_type = FILE /var/log/servicelog + log_on_success = HOST PID + log_on_failure = HOST +} + +# default: on +# description: Gophernicus - Modern full-featured gopher server +service gopher +{ + socket_type = stream + protocol = tcp + port = 70 + wait = no + user = nobody + server = /usr/sbin/gophernicus + server_args = -r /var/gopher + disable = no +}