2017-03-24 21:27:12 +01:00
|
|
|
# Usage:
|
|
|
|
#
|
2018-05-29 03:22:26 +02:00
|
|
|
# This uses a custom installs a kernel module hence the mounts
|
|
|
|
|
2017-03-24 21:27:12 +01:00
|
|
|
# docker run --rm -it \
|
|
|
|
# --name wireguard \
|
2018-05-29 03:22:26 +02:00
|
|
|
# -v /lib/modules:/lib/modules \
|
2017-03-24 21:27:12 +01:00
|
|
|
# -v /usr/src:/usr/src:ro \
|
2018-05-29 03:22:26 +02:00
|
|
|
# r.j3ss.co/wireguard:install
|
2017-03-24 21:27:12 +01:00
|
|
|
#
|
|
|
|
FROM alpine:latest
|
|
|
|
LABEL maintainer "Jessie Frazelle <jess@linux.com>"
|
|
|
|
|
|
|
|
RUN apk add --no-cache \
|
|
|
|
build-base \
|
|
|
|
ca-certificates \
|
2018-12-11 21:08:16 +01:00
|
|
|
elfutils-libelf \
|
2018-05-29 03:22:26 +02:00
|
|
|
libelf-dev \
|
2017-03-24 21:27:12 +01:00
|
|
|
libmnl-dev
|
|
|
|
|
|
|
|
# https://git.zx2c4.com/WireGuard/refs/
|
2018-12-18 16:51:49 +01:00
|
|
|
ENV WIREGUARD_VERSION 0.0.20181218
|
2017-03-24 21:27:12 +01:00
|
|
|
|
|
|
|
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" ]
|
2018-05-29 03:22:26 +02:00
|
|
|
CMD [ "wg", "--help" ]
|