-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
47 lines (43 loc) · 1.44 KB
/
Dockerfile
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
46
47
# FROM centos:7 AS builder
# RUN yum group install -y "Development Tools" &&\
# yum install -y epel-release &&\
# yum install -y git &&\
# yum install -y go
# RUN git clone https://github.com/WireGuard/wireguard-go.git &&\
# cd wireguard-go &&\
# make &&\
# cp ./wireguard-go /tmp/wireguard-go
FROM golang:1.16-rc-alpine AS builder
RUN apk update && apk upgrade && \
apk add --no-cache bash git openssh make
RUN git clone https://github.com/WireGuard/wireguard-go.git &&\
cd wireguard-go &&\
make &&\
cp ./wireguard-go /tmp/wireguard-go
FROM alpine:3.12.3
ENV INTERFACE_NAME=wg0
ENV WIREGUARD_IP=""
ENV WIREGUARD_KEY_PATH=""
ENV WIREGUARD_CONFIG_PATH=""
ENV WIREGUARD_EXTRA_ROUTED_CIDRS=""
RUN apk add -U wireguard-tools iproute2 net-tools
COPY --from=builder /tmp/wireguard-go /bin/wireguard-go
COPY entrypoint.sh /bin/entrypoint.sh
RUN chmod +x /bin/entrypoint.sh &&\
chmod +x /bin/wireguard-go
ENTRYPOINT ["entrypoint.sh"]
#FROM centos:7
#ENV INTERFACE_NAME=wg0
#ENV WIREGUARD_IP=""
#ENV WIREGUARD_KEY_PATH=""
#ENV WIREGUARD_CONFIG_PATH=""
#ENV WIREGUARD_EXTRA_ROUTED_CIDRS=""
#RUN yum install -y epel-release &&\
# yum install -y iproute &&\
# yum install -y kernel-plus wireguard-tools &&\
# yum install -y net-tools
#COPY --from=builder /tmp/wireguard-go /bin/wireguard-go
#COPY entrypoint.sh /bin/entrypoint.sh
#RUN chmod +x /bin/entrypoint.sh &&\
# chmod +x /bin/wireguard-go
#ENTRYPOINT ["entrypoint.sh"]