diff --git a/docker/Dockerfile b/docker/Dockerfile index 0364a32..8e659de 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,24 +1,30 @@ -FROM golang:1.24 AS awg +FROM golang:1.24 AS awg-go -RUN git clone https://github.com/amnezia-vpn/amneziawg-go /awg +RUN git clone https://github.com/WGDashboard/amneziawg-go /awg WORKDIR /awg RUN go mod download && \ go mod verify && \ go build -ldflags '-linkmode external -extldflags "-fno-PIC -static"' -v -o /usr/bin +FROM alpine:latest AS awg-tools + +RUN apk update && apk add --no-cache \ + make git build-base linux-headers \ + && git clone https://github.com/WGDashboard/amneziawg-tools \ + && cd amneziawg-tools/src \ + && make \ + && chmod +x wg* + FROM alpine:latest LABEL maintainer="dselen@nerthus.nl" -RUN apk update && apk add \ +RUN apk update && apk add --no-cache \ iproute2 iptables bash curl wget unzip procps sudo \ - tzdata wireguard-tools python3 py3-psutil py3-bcrypt openresolv \ - && cd /usr/bin/ \ - && wget $(curl -s https://api.github.com/repos/amnezia-vpn/amneziawg-tools/releases/latest | grep 'alpine' | cut -d : -f 2,3 | tr -d '", ' | tail -n 1) \ - && unzip -j alpine-3.19-amneziawg-tools.zip \ - && chmod +x /usr/bin/awg /usr/bin/awg-quick \ - && rm alpine-3.19-amneziawg-tools.zip + tzdata wireguard-tools python3 py3-psutil py3-bcrypt openresolv -COPY --from=awg /usr/bin/amneziawg-go /usr/bin/amneziawg-go +COPY --from=awg-go /usr/bin/amneziawg-go /usr/bin/amneziawg-go +COPY --from=awg-tools /amneziawg-tools/src/wg /usr/bin/awg +COPY --from=awg-tools /amneziawg-tools/src/wg-quick/linux.bash /usr/bin/awg-quick # Declaring environment variables, change Peernet to an address you like, standard is a 24 bit subnet. ARG wg_net="10.0.0.1" \