| giolekva | 6b879db | 2020-06-10 21:00:39 +0400 | [diff] [blame^] | 1 | FROM golang:1.14.1-alpine3.11 as builder |
| 2 | |
| 3 | ARG wg_go_tag=v0.0.20200320 |
| 4 | ARG wg_tools_tag=v1.0.20200513 |
| 5 | |
| 6 | RUN apk add --update git build-base libmnl-dev iptables |
| 7 | |
| 8 | RUN git clone https://git.zx2c4.com/wireguard-go && \ |
| 9 | cd wireguard-go && \ |
| 10 | git checkout $wg_go_tag && \ |
| 11 | make && \ |
| 12 | make install |
| 13 | |
| 14 | ENV WITH_WGQUICK=yes |
| 15 | RUN git clone https://git.zx2c4.com/wireguard-tools && \ |
| 16 | cd wireguard-tools && \ |
| 17 | git checkout $wg_tools_tag && \ |
| 18 | cd src && \ |
| 19 | make && \ |
| 20 | make install |
| 21 | |
| 22 | FROM alpine:3.11 |
| 23 | |
| 24 | RUN apk add --no-cache --update bash libmnl iptables openresolv iproute2 |
| 25 | |
| 26 | COPY --from=builder /usr/bin/wireguard-go /usr/bin/wg* /usr/bin/ |
| 27 | COPY entrypoint.sh /entrypoint.sh |
| 28 | |
| 29 | CMD ["/entrypoint.sh"] |