Thanks @NOXCIS for providing ubuntu image for AWG support

This commit is contained in:
Donald Zou 2024-12-09 16:18:03 +08:00
parent 907a142c8d
commit dbbee4c001
2 changed files with 85 additions and 0 deletions

27
Ubuntu.Dev.Compose.yaml Normal file
View File

@ -0,0 +1,27 @@
services:
wireguard-dashboard:
build:
context: .
dockerfile: Ubuntu.Dev.Dockerfile
#image: donaldzou/wgdashboard:latest
restart: unless-stopped
container_name: wgdashboard
#environment:
#- tz= # <--- Set container timezone, default: Europe/Amsterdam.
#- global_dns= # <--- Set global DNS address, default: 1.1.1.1.
#- isolate= # <--- Set the interfaces that will disallow peer communication, default: 'none'.
#- public_ip= # <--- Set public IP to ensure the correct one is chosen, defaulting to the IP give by ifconfig.me.
ports:
- 10086:10086/tcp
- 51820:51820/udp
volumes:
- conf:/etc/wireguard
- data:/data
cap_add:
- NET_ADMIN
devices:
- /dev/net/tun:/dev/net/tun
volumes:
conf:
data:

58
Ubuntu.Dev.Dockerfile Normal file
View File

@ -0,0 +1,58 @@
# Compiler: Build AmneziaWG (Obfuscated Wireguard)
FROM golang:1.23.4-bookworm@sha256:ef30001eeadd12890c7737c26f3be5b3a8479ccdcdc553b999c84879875a27ce AS compiler
WORKDIR /go
RUN apt-get update && apt-get install -y --no-install-recommends \
git make bash build-essential \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
RUN git clone --depth=1 https://github.com/amnezia-vpn/amneziawg-tools.git && \
git clone --depth=1 https://github.com/amnezia-vpn/amneziawg-go.git
RUN cd /go/amneziawg-tools/src && make
RUN cd /go/amneziawg-go && \
go get -u ./... && \
go mod tidy && \
make && \
chmod +x /go/amneziawg-go/amneziawg-go /go/amneziawg-tools/src/wg /go/amneziawg-tools/src/wg-quick/linux.bash
RUN echo "DONE AmneziaWG"
FROM scratch AS bins
COPY --from=compiler /go/amneziawg-go/amneziawg-go /amneziawg-go
COPY --from=compiler /go/amneziawg-tools/src/wg /awg
COPY --from=compiler /go/amneziawg-tools/src/wg-quick/linux.bash /awg-quick
FROM ubuntu:latest
WORKDIR /WGDashboard
ENV TZ=UTC
EXPOSE 10086
COPY ./src /WGDashboard/
RUN apt-get update -y && \
apt-get upgrade -y && \
apt-get install wireguard sudo python3 python3-venv python3-pip net-tools -y && \
apt install iproute2 -y && \
mkdir -p /etc/amnezia/amneziawg
# Copy AmneziaWG binaries
COPY entrypoint.sh /WGDashboard/entrypoint.sh
COPY --from=bins /amneziawg-go /usr/bin/amneziawg-go
COPY --from=bins /awg /usr/bin/awg
COPY --from=bins /awg-quick /usr/bin/awg-quick
# Install necessary tools and libraries in the final image
RUN chmod +x /WGDashboard/wgd.sh && chmod +x /WGDashboard/entrypoint.sh
RUN if [ ! -c /dev/net/tun ]; then \
mkdir -p /dev/net && mknod /dev/net/tun c 10 200; \
fi
RUN ./wgd.sh install
# Start the script and keep it alive by tailing the logs
CMD ["/bin/bash", "-c", "/WGDashboard/wgd.sh start && tail -f /dev/null"]