From 303ac917e55a3792e04b32046dc0da9ada836975 Mon Sep 17 00:00:00 2001 From: Jess Frazelle Date: Fri, 24 Mar 2017 13:27:12 -0700 Subject: [PATCH] add wireguard Signed-off-by: Jess Frazelle --- wireguard/Dockerfile | 37 +++++++++++++++++++++++++++++++++++++ wireguard/entrypoint.sh | 11 +++++++++++ 2 files changed, 48 insertions(+) create mode 100644 wireguard/Dockerfile create mode 100755 wireguard/entrypoint.sh diff --git a/wireguard/Dockerfile b/wireguard/Dockerfile new file mode 100644 index 0000000..88d1f93 --- /dev/null +++ b/wireguard/Dockerfile @@ -0,0 +1,37 @@ +# Usage: +# +# (this uses a custom kernel module hence the mounts) +# docker run --rm -it \ +# --name wireguard \ +# --privileged \ +# -v /lib/modules:/lib/modules:ro \ +# -v /usr/src:/usr/src:ro \ +# r.j3ss.co/wireguard +# +FROM alpine:latest +LABEL maintainer "Jessie Frazelle " + +RUN apk add --no-cache \ + build-base \ + ca-certificates \ + libmnl-dev + +# https://git.zx2c4.com/WireGuard/refs/ +ENV WIREGUARD_VERSION 0.0.20170324 + +RUN set -x \ + && apk add --no-cache --virtual .build-deps \ + git \ + && git clone --depth 1 --branch "${WIREGUARD_VERSION}" https://git.zx2c4.com/WireGuard.git /wireguard \ + && ( \ + cd /wireguard/src \ + && make tools \ + && make -C tools install \ + && make -C tools clean \ + ) \ + && apk del .build-deps + +COPY entrypoint.sh /usr/local/bin/entrypoint.sh + +ENTRYPOINT [ "/usr/local/bin/entrypoint.sh" ] +CMD [ "wg" ] diff --git a/wireguard/entrypoint.sh b/wireguard/entrypoint.sh new file mode 100755 index 0000000..de5a676 --- /dev/null +++ b/wireguard/entrypoint.sh @@ -0,0 +1,11 @@ +#!/bin/sh +set -e + +( +cd /wireguard/src +make module +make module-install +make clean +) + +exec $@