badvpn/Dockerfile

26 lines
1.1 KiB
Docker

FROM debian:latest AS base
ENV DEBIAN_FRONTEND="noninteractive"
RUN apt update && apt -y install build-essential libnspr4-dev libnss3-dev sudo wget curl git openssl libssl-dev make build-essential git pkg-config cmake
COPY ./ /tmp/Copiler/badvpn
WORKDIR /tmp/Copiler/badvpn/build/
# tun2socks
FROM base AS tun2socks_build
RUN cmake ../ -DBUILD_NOTHING_BY_DEFAULT=1 -DBUILD_TUN2SOCKS=1 -DCMAKE_INSTALL_PREFIX=./usr && make install
# Badvpn
FROM base AS udpgw_build
RUN (cmake ../ -DBUILD_NOTHING_BY_DEFAULT=1 -DBUILD_UDPGW=1 -DCMAKE_INSTALL_PREFIX=./usr --trace-expand||(cat CMakeFiles/CMakeError.log && exit 1)) && make install
# tun2socks
FROM debian:latest AS tun2socks
COPY --from=tun2socks_build /tmp/Copiler/badvpn/build/usr/ /usr/
WORKDIR /root
ENTRYPOINT [ "/usr/bin/badvpn-tun2socks", "--logger", "stdout", "--loglevel", "debug" ]
# Badvpn
FROM debian:latest AS udpgw
COPY --from=udpgw_build /tmp/Copiler/badvpn/build/usr/ /usr/
WORKDIR /root
ENTRYPOINT [ "/usr/bin/badvpn-udpgw", "--logger", "stdout", "--loglevel", "debug", "--listen-addr", "0.0.0.0:7300" ]