-
Notifications
You must be signed in to change notification settings - Fork 41
/
Dockerfile
36 lines (26 loc) · 974 Bytes
/
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
ARG GOLANG_VERSION=1.20
ARG ALPINE_VERSION=3.18
FROM golang:${GOLANG_VERSION}-alpine${ALPINE_VERSION} AS builder
ARG wg_go_tag=0.0.20230223
ARG wg_tools_tag=v1.0.20210914
RUN apk add --update git build-base libmnl-dev iptables
RUN git clone https://git.zx2c4.com/wireguard-go && \
cd wireguard-go && \
git checkout $wg_go_tag && \
make && \
make install
ENV WITH_WGQUICK=yes
RUN git clone https://git.zx2c4.com/wireguard-tools && \
cd wireguard-tools && \
git checkout $wg_tools_tag && \
cd src && \
make && \
make install
COPY healthcheck.go /go/src/healthcheck.go
RUN go build -ldflags="-s -w" -o /go/bin/healthcheck /go/src/healthcheck.go
FROM alpine:${ALPINE_VERSION}
RUN apk add --no-cache --update bash libmnl iptables openresolv iproute2
COPY --from=builder /usr/bin/wireguard-go /usr/bin/wg* /usr/bin/
COPY --from=builder /go/bin/healthcheck /usr/bin/healthcheck
COPY entrypoint.sh /entrypoint.sh
CMD ["/entrypoint.sh"]