-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
45 lines (38 loc) · 1.19 KB
/
Copy pathDockerfile
File metadata and controls
45 lines (38 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Usage:
# 此镜像需要宿主机内核版本在4.x以上才可使用
# This uses a custom installs a kernel module hence the mounts
# docker run --rm -it \
# --name wireguard \
# -v /lib/modules:/lib/modules \
# r.j3ss.co/wireguard:install
FROM alpine:3.9
# https://git.zx2c4.com/WireGuard/refs/
ENV WIREGUARD_VERSION 0.0.20190227
ENV WG_QUICK_URL https://git.zx2c4.com/WireGuard/plain/src/tools/wg-quick/linux.bash
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories \
&& apk add --no-cache \
ca-certificates \
elfutils-libelf \
libelf-dev \
libmnl-dev \
libmnl \
wget \
curl \
openresolv \
iptables \
bash \
&& apk add --no-cache --virtual .build-deps git build-base \
&& 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
RUN wget -O /bin/wg-quick $WG_QUICK_URL \
&& chmod +x /bin/wg-quick
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
ENTRYPOINT [ "/usr/local/bin/entrypoint.sh" ]
CMD ["wg-quick", "up", "wg0"]