github.com/amnezia-vpn/amnezia-wg@v0.1.8/Dockerfile (about)

     1  FROM golang:1.20 as awg
     2  COPY . /awg
     3  WORKDIR /awg
     4  RUN go mod download && \
     5      go mod verify && \
     6      go build -ldflags '-linkmode external -extldflags "-fno-PIC -static"' -v -o /usr/bin
     7  
     8  FROM alpine:3.15 as awg-tools
     9  ARG AWGTOOLS_RELEASE="1.0.20231215"
    10  RUN apk --no-cache add linux-headers build-base bash && \
    11      wget https://github.com/amnezia-vpn/amnezia-wg-tools/archive/refs/tags/v${AWGTOOLS_RELEASE}.zip && \
    12      unzip v${AWGTOOLS_RELEASE}.zip && \
    13      cd amnezia-wg-tools-${AWGTOOLS_RELEASE}/src && \
    14      make -e LDFLAGS=-static && \
    15      make install
    16  
    17  FROM alpine:3.15
    18  RUN apk --no-cache add iproute2 bash
    19  COPY --from=awg /usr/bin/amnezia-wg /usr/bin/wireguard-go
    20  COPY --from=awg-tools /usr/bin/wg /usr/bin/wg-quick /usr/bin/