-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
23 lines (18 loc) · 768 Bytes
/
Copy pathDockerfile
File metadata and controls
23 lines (18 loc) · 768 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
FROM debian:9.5
LABEL maintainer="[email protected]"
RUN echo "deb http://deb.debian.org/debian/ unstable main" > /etc/apt/sources.list.d/unstable.list \
&& printf 'Package: *\nPin: release a=unstable\nPin-Priority: 150\n' > /etc/apt/preferences.d/limit-unstable \
&& apt-get update && apt-get install -y wireguard wget iptables qrencode \
&& rm -rf /var/cache/apt/* \
&& mkdir /etc/wireguard/config
ENV ROLE="SERVER"
ENV NAME=""
ENV IP=""
ENV PORT="32500"
ENV CLIENTS=""
ENV OUTPUT=FILE
COPY "autostart.sh" /home
CMD iface=$(ip r | grep default | awk -Fdev '{print $2}' | awk -F " " '{print $1}') \
&& iptables -t nat -A POSTROUTING -o $iface -j MASQUERADE \
&& echo "${ROLE} ${NAME}" && sh /home/autostart.sh ${ROLE} ${NAME} \
&& tail -f /dev/stdout